Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<ol> <li><p>Toplevel window</p></li> <li><p>WS_EX_APPWINDOW -> taskbar, no matter the other styles!</p></li> <li><p>OWNER must be NULL (GetWindow(window, GW_OWNER))</p></li> <li><p>no: WS_EX_NOACTIVATE or WS_EX_TOOLWINDOW:</p></li> </ol> <p>order is important. </p> <p>second question: in windows xp/vista it was possible to get into the process of the taskbar and get all window ID´s:</p> <pre><code>void EnumTasklistWindows() { int b2 = 0; TBBUTTON tbButton; DWORD dwProcessId = 0, dwThreadId = 0; HWND hDesktop =::GetDesktopWindow(); HWND hTray =::FindWindowEx(hDesktop, 0, ("Shell_TrayWnd"), NULL); HWND hReBar =::FindWindowEx(hTray, 0, ("ReBarWindow32"), NULL); HWND hTask =::FindWindowEx(hReBar, 0, ("MSTaskSwWClass"), NULL); HWND hToolbar =::FindWindowEx(hTask, 0, ("ToolbarWindow32"), NULL); LRESULT count =::SendMessage(hToolbar, TB_BUTTONCOUNT, 0, 0); dwThreadId = GetWindowThreadProcessId(hToolbar, &amp;dwProcessId); shared_ptr&lt;void&gt; hProcess (OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcessId), CloseHandle); if (NULL == hProcess.get()) { return; } memset(&amp;tbButton, 0, sizeof(TBBUTTON)); for (int i = 0; i &lt; count; i++) { memset(&amp;tbButton, 0, sizeof(TBBUTTON)); shared_ptr&lt;void&gt; lpRemoteBuffer ( VirtualAllocEx(hProcess.get(), NULL, sizeof(TBBUTTON), MEM_COMMIT, PAGE_READWRITE), bind&lt;BOOL&gt;(VirtualFreeEx, hProcess.get(), _1, 0, MEM_RELEASE)); if (NULL == lpRemoteBuffer.get()) { return; } SendMessage(hToolbar, TB_GETBUTTON, i, (LPARAM) lpRemoteBuffer.get()); b2 = ReadProcessMemory(hProcess.get(), lpRemoteBuffer.get(), (LPVOID) &amp; tbButton, sizeof(TBBUTTON), NULL); if (0 == b2) { continue; } BYTE localBuffer[0x1000]; BYTE *pLocalBuffer = localBuffer; DWORD_PTR ipLocalBuffer = (DWORD_PTR) pLocalBuffer; pLocalBuffer = localBuffer; ipLocalBuffer = (DWORD_PTR) pLocalBuffer; DWORD_PTR lpRemoteData = (DWORD_PTR) tbButton.dwData; ReadProcessMemory(hProcess.get(), (LPVOID) lpRemoteData, (LPVOID) ipLocalBuffer, sizeof(DWORD_PTR), NULL); HWND windowHandle; memcpy(&amp;windowHandle, (void *) ipLocalBuffer, 4); if (windowHandle != NULL) { trace ("adding button: %x\n", windowHandle); } } } </code></pre> <p>this not possible with windows 7 anymore. so you need to loop over all toplevel windows.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload