ws_ex_toolwindow jumping credentials window destroy
weird issue:
- open infinite notepad window
- create toolwindow (style ws_ex_toolwindow)
- create 2 some-more windows (normal overlapped) (ws_overlapped)
- close those 2 overlapped windows (child desktop toolwindow)
- the toolwindow jumps behind notepad window
does anyone know since case? i doing wrong? i contend 'bug windows', nonetheless magnitude case.
to answer questions:
it dialog window, nonetheless full window. i have repremand children (ie: child desktop), taskbar opening children seem (probably simply fixable), nonetheless presumably way, bug still happens.
i have enclosed instance formula shows issue. i am anticipating i am only formulating window wrong mandatory respond summary i am responding to.
in example, apparatus window open (no assign bar entry, wanted). following click window, subwindow open. click subwindow, another window open. following tie both new subwindows uncanny window, instead removing focus, jumps immediately behind windows (notepad, etc).
thanks any help!
example formula clarify:
// windowtoback.cpp : defines opening indicate application.
//
#include "stdafx.h"
#include "windowtoback.h"
// tellurian variables:
hinstance g_instance;
hwnd g_mainwnd = null;
wchar_t *szwindowclass = l"windowtobacksub";
wchar_t *szwindowclass2 = l"windowtobacksub2";
atom myregisterclass(hinstance hinstance);
bool initinstance(hinstance, int);
lresult callback wndproc(hwnd, uint, wparam, lparam);
lresult callback wndproc2(hwnd, uint, wparam, lparam);
int_ptr callback about(hwnd, uint, wparam, lparam);
int apientry _twinmain(hinstance hinstance,hinstance hprevinstance,lptstr lpcmdline,int ncmdshow)
{
unreferenced_parameter(hprevinstance);
unreferenced_parameter(lpcmdline);
msg msg;
myregisterclass(hinstance);
// perform concentration initialization:
if (!initinstance (hinstance, ncmdshow))
{
relapse false;
}
// sure summary loop:
while (getmessage(&msg, null, 0, 0))
{
translatemessage(&msg);
dispatchmessage(&msg);
}
return (int) msg.wparam;
}
atom myregisterclass(hinstance hinstance)
{
wndclassex wcex;
wcex.cbsize = sizeof(wndclassex);
wcex.style = cs_hredraw | cs_vredraw;
wcex.lpfnwndproc = wndproc;
wcex.cbclsextra = 0;
wcex.cbwndextra = 0;
wcex.hinstance = hinstance;
wcex.hicon = loadicon(hinstance, makeintresource(idi_windowtoback));
wcex.hcursor = loadcursor(null, idc_arrow);
wcex.hbrbackground = (hbrush)(color_window+1);
wcex.lpszmenuname = makeintresource(idc_windowtoback);
wcex.lpszclassname = szwindowclass;
wcex.hiconsm = loadicon(wcex.hinstance, makeintresource(idi_small));
registerclassex(&wcex);
wcex.lpfnwndproc = wndproc2;
wcex.lpszclassname = szwindowclass2;
return registerclassex(&wcex);
}
bool initinstance(hinstance hinstance, int ncmdshow)
{
g_instance = hinstance;
g_mainwnd = createwindowex(ws_ex_toolwindow,szwindowclass, szwindowclass,ws_overlapped,
cw_usedefault, 0, cw_usedefault, 0, null, null, hinstance, null);
(!g_mainwnd) relapse false;
showwindow(g_mainwnd, ncmdshow);
updatewindow(g_mainwnd);
relapse true;
}
lresult callback wndproc(hwnd hwnd, uint message, wparam wparam, lparam lparam)
{
switch (message)
{
box wm_lbuttondown:
{
hwnd l_hwnd = createwindow(szwindowclass2, szwindowclass2, ws_visible | ws_overlappedwindow,
cw_usedefault, 0, cw_usedefault, 0, null, null, g_instance, null);
showwindow(l_hwnd,sw_show);
break;
}
box wm_destroy:
{
postquitmessage(0);
relapse 0;
}
}
return defwindowproc(hwnd, message, wparam, lparam);
}
lresult callback wndproc2(hwnd hwnd, uint message, wparam wparam, lparam lparam)
{
switch (message)
{
box wm_lbuttondown:
{
hwnd l_hwnd = createwindow(szwindowclass2, szwindowclass2, ws_visible | ws_overlappedwindow,
cw_usedefault, 0, cw_usedefault, 0, null, null, g_instance, null);
showwindow(l_hwnd,sw_show);
}
break;
}
return defwindowproc(hwnd, message, wparam, lparam);
}
Comments
Post a Comment