Hello all, Could you please help me with this situation? In the middle of my program, I create a FULL SCREEN TRANSPARENT HIDDEN WINDOW which is TOPMOST. When I click on my left mouse button, I want to retrieve the handle to the window under cursor(next z-order) underneath this transparent hidden window. I am doing it like this when handling WM_MOUSEMOVE message, it is causing too much flickering. // A full screen transparent window shows up // Temporarily ShowWindow(hwnd, SW_HIDE) the full screen transparent window // GetCursorPos() and do a WindowFromPoint() to get the window under cursor // ShowWindow(hwnd, SW_SHOW) full screen transparent window Could you show me how to use WindowFromPoint(), ChildWindowFromPoint(), and ChildWindowFromPointEx() to achieve this without hiding and showing the full-screen transparent window? Or is there any other way to do this? Thank you very much in advance. :rose:
JavaTony
Posts
-
How to use WindowFromPoint and ChildWindowFromPoint? -
How to disable right-click popup menu system wideHello, I am using a windows hook(WH_JOURNALRECORD) to hook right-click message system-wide. Once I detect a right-click message in the hook procedure, I want to remove the right-click message from the system message queue and prevent it from passing on to any window under the cursor or desktop('cause that will bring up whatever right-click context menu. I have no success on this. Could you please show me how to achieve this? Thank you very much in advance.:)
-
Help with creating Always On Top hidden windowHello, Could anyone please show me how to create an Always On Top window like ICQ or Task Manager except it is transparent? I want the window to be Topmost and no application being maximized can stay above it. I am creating my window like this, but it is not always on top. Please help, tell, or show me what to do, thank you. // Create the window (this doesn't work, I don't know why) // If I do a Alt-Tab, other windows being maximized can still go above it hwndHotkey = CreateWindowEx(WS_EX_TRANSPARENT | WS_EX_TOPMOST, szWindowNameHotkey, NULL, WS_POPUP, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), NULL, NULL, ghInstance, NULL); SetWindowPos(hwndHotkey, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); :)
-
Please help with Menu Capture, thank you.Hi, I am trying the following code to enumerate child windows of Start Menu. However, it doesn't seem to work. Could you take a look and tell me what I did wrong or is there another way to do it. Thank you very much. RECT rcMenu; BOOL CaptureMenuToClipboard(BOOL fIncMouseCursor, BOOL fIncMenuBar) { /*BOOL bSuccess = FALSE; POINT ptStartMenu; ptStartMenu.x = 1; ptStartMenu.y = 1; HWND hStartMenu; HWND hShellTrayWindow = FindWindow("Shell_TrayWnd", NULL); hStartMenu = ChildWindowFromPoint(hShellTrayWindow, ptStartMenu); if (EnumChildWindows(hStartMenu, (WNDENUMPROC)EnumChildProc, NULL)) bSuccess = TRUE; if (bSuccess) { if (!CopyScreenToClipboard(NULL, &rcMenu, fIncMouseCursor)) bSuccess = FALSE; } return bSuccess;*/ } BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) { BOOL bFlag = FALSE; if (GetWindowRect(hwnd, &rcMenu)) bFlag = TRUE; return bFlag; } :) ;) ;) ;) :-D
-
Please help with Menu Capture, thank you.Hi, I am trying the following code to enumerate child windows of Start Menu. However, it doesn't seem to work. Could you take a look and tell me what I did wrong or is there another way to do it. Thank you very much. RECT rcMenu; BOOL CaptureMenuToClipboard(BOOL fIncMouseCursor, BOOL fIncMenuBar) { /*BOOL bSuccess = FALSE; POINT ptStartMenu; ptStartMenu.x = 1; ptStartMenu.y = 1; HWND hStartMenu; HWND hShellTrayWindow = FindWindow("Shell_TrayWnd", NULL); hStartMenu = ChildWindowFromPoint(hShellTrayWindow, ptStartMenu); if (EnumChildWindows(hStartMenu, (WNDENUMPROC)EnumChildProc, NULL)) bSuccess = TRUE; if (bSuccess) { if (!CopyScreenToClipboard(NULL, &rcMenu, fIncMouseCursor)) bSuccess = FALSE; } return bSuccess;*/ } BOOL CALLBACK EnumThreadWndProc(HWND hwnd, LPARAM lParam) { BOOL bFlag = FALSE; if (GetWindowRect(hwnd, &rcMenu)) bFlag = TRUE; return bFlag; } :) ;) ;) ;) :-D
-
Please help with AutoScroll for Screen CaptureDoes anyone have any suggestion, tips, or code snippets on how to do a AutoScroll(automatically scrolling the scroll bar to capture entire client area content) Screen Capture on Client Area Window? Thank you very much.:) ;) ;P :-D
-
Please help with Menu Capture, thank you.Hi there, I am able to capture pop-up menu using this code. HWND hPopupMenu = FindWindow("#32768",NULL); if (hPopupMenu && IsWindowVisible(hPopupMenu)) GetWindowRect(hPopupMenu, &rcMenu); This doesn't work for Microsoft Office Products and Windows Explore 'cause their menus are not standard menu. For instance, Microsoft Word. I am trying this. I used Spy++ to find out the class name and window caption for the menu bar. I tried FindWindow("MsoCommandBar", "Menu Bar") on Microsoft Word. It doesn't work at all. Could someone give me some pointers how to capture pop-up windows from Microsoft Office Products and Windows Explorer. Thank you very much. Will EnumChildWindows or EnumThreadWindows API functions help for this case? If so, could you gimme some tips. Thank you again. :) :)
-
Please help with creating a Hidden Window inside a Win32 DLL, thank you.Hi there, Please help me, I have been so frustrated. I am working on a Win32 DLL. Inside the dll, I am trying to create a popup window which is hidden and covers the entire desktop so I can process mouse message across the screen and do rubber banding. I am doing this because of the restriction of SetCapture(HWND hwnd) API. What I can do now is that as soon as the client loads the DLL, a hidden window will be created and mouse messages will be processed in GrabProc Callback function. Instead of creating the hidden window when the dll is first loaded, I am hoping to create a hidden window when the mouse is down and destroy it when the mouse it up. I am a newbie on Windows Programming. Would someone please give me some pointers and show me how to accomplish what I need. Thank you very much for your help. BOOL APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { if (dwReason == DLL_PROCESS_ATTACH) { CreateHiddenWindow(); } } BOOL CreateHiddenWindow() { static TCHAR szAppName[] = TEXT ("Test") ; HWND hwnd ; MSG msg ; WNDCLASS wndclass ; wndclass.style = CS_HREDRAW | CS_VREDRAW ; wndclass.lpfnWndProc = GrabProc ; wndclass.cbClsExtra = 0 ; wndclass.cbWndExtra = 0 ; wndclass.hInstance = g_hInstance ; wndclass.hIcon = NULL; wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); wndclass.hbrBackground = NULL; wndclass.lpszMenuName = NULL; wndclass.lpszClassName = szAppName ; if (!RegisterClass (&wndclass)) { MessageBox (NULL, TEXT ("This program requires Windows NT!"), szAppName, MB_ICONERROR) ; return 0 ; } hwnd = CreateWindowEx(WS_EX_TRANSPARENT, szAppName, NULL, WS_POPUP, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), NULL, NULL, g_hInstance, NULL); ShowWindow(hwnd, SW_SHOW); UpdateWindow (hwnd) ; while (GetMessage (&msg, NULL, 0, 0)) { TranslateMessage (&msg) ; DispatchMessage (&msg) ; } return msg.wParam ; } LRESULT CALLBACK GrabProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { // Handle mouse down, move, up messages for entire screen // rubber banding sw
-
Please help with creating a hidden windowHi, Could anyone please show me an example how to create a hidden window? Thank you very much.:) :) :)
-
Multi-monitor Desktop CaptureHi, Does anyone have any tips or pointers for capturing an entire screen of other monitors other than primary monitor? Thank you very much. :) :) :) :)
-
Please help with using GetMenu functionHi, Could you please tell me how to use HMENU GetMenu( HWND hWnd // handle to window ); function to get HMENU of Start Menu and Context Menu(right-click)? I use GetMenu(GetForegroundWindow()) to get HMENU for standard application menu, but I don't know how to get HMENU for Start Menu and Context Menu(right-click). Could you please show me how. Thank you very much.
-
Please help with using RegisterHotKey in a Win32 DLLHi, I am trying to use BOOL RegisterHotKey( HWND hWnd, // window to receive hot-key notification int id, // identifier of hot key UINT fsModifiers, // key-modifier flags UINT vk // virtual-key code ); in my Win32 DLL. I have questions about what to pass to the first parameter. Can I create a hidden window in my DLL and pass its handle to the first parameter of RegisterHotKey function? And then I can process messages received by the hidden window? If this is a way to do it, could you please show me and give me some pointers how to do it, thank you very much. Or do you have any other easy ways to do this? Please let me know, thank you a lot. :) :) :) :) :) :)
-
Converting CString to int in Visaul C++, please help.Hi, I have two variables with types CString and int. int nWidth; CString strWidth; strWidth = "110"; How do I convert strWidth("110") to int type(110) so I can store it in nWidth? Please show me how to do this, thank you very much. :)
-
Help with getting a HMENU for the Right-Click Context MenuHi, I am trying to screen capture right click context menu. I am using GetMenu, GetSubMenu, and GetMenuItemInfo APIs to capture standard application menu. Now, I want to capture right click context menu, but I don't know how to get a handle to the context menu(HMENU). Does windows generate a window message and put it on the message queue when the right-click context menu pops up? If so, could you give me some hints how to utilize the message to get a handle of the pop-up menu. If you have any tips, pointers, or samples how to do this, could you help me. Thank you very much in advance. :)
-
Help with capturing Full-screen DOS to a bitmap fileHi, I am trying to capture the content of Full-screen DOS console to a bitmap file. Here are the steps I am trying. When the user opens up DOS console window, and does ALT+ENTER to go into Full-screen DOS mode. The user then hits PrintScreen Key. This copies the content of the Full-screen DOS into the clipboard in text format. I am able to intercept the PrintScreen Key by implementing a keyboard hook. My question is how do I convert the text format data on the clipboard into a bitmap file? Can I store the text data in a buffer, create a bitmap, and draw text data on the bitmap? Could you give me some tips, pointers, or examples how to do this? Thank you very much in advance.
-
Help with using InvalidateRect API function to update only part of the screenHi, I am doing an entire screen capture INCLUDING THE MOUSE CURSOR. For GDI function calls, the mouse cursor is automatically hidden. Therefore, I have to get a handle of the current mouse cursor and use DrawIcon to draw it onto the screen. After the screen capture, I have to invalidate the area where the mouse cursor is drawn so the drawn mouse cursor won't stay on the screen. I am using InvalidateRect(NULL, NULL, TRUE) to redraw all the windows, but this results in a very serious screen flickering while capturing the screen. I cannot figure out how to invalidate only the area where the mouse cursor is drawn. Could you give me some pointers, tips, or samples how to achieve this with InvalidateRect function? Thank you very much for your help.
-
Please help with Screen Capture Wallpaper with PaintDesktop(HDC hdc) APIHello all, I am trying to capture desktop wallpaper into memory device context, but it wasn't successful. Here are the steps I did. 1: create a DC for the screen and create a compatible memory DC to screen DC 2: get screen resolution for bitmap width and height 3: create a bitmap compatible with the screen DC with width and height obtained from step 2 4: select created bitmap into memory DC as a drawing surface 5: create clipping region in the memory DC 6: paint the desktop pattern to the memory DC with PaintDesktop(HDC hdc) API function 7: copy the bitmap in the memory DC on to the clipboard, I got a black image when pasting it to WordPad. Could you please give me some pointers for this problem? Did you spot any problems in the steps I performed? I can tell that PaintDesktop() didn't paint the desktop pattern into my memory DC. I really got stuck. Thank you very much for your help. :) :) ;) :) :) :) :)