|
-
April 30th, 2008, 11:42 PM
#6
Re: a window that stays topmost
Code:
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hInst = hInstance; // Store instance handle in our global variable
hWnd = CreateWindowEx( WS_EX_TOPMOST,
szWindowClass,
szTitle,
WS_MAXIMIZE | WS_POPUP,
0, 0, CW_USEDEFAULT, CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
// hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
// CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
if (!hWnd)
{
return FALSE;
}
SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 100, 100, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
// ShowWindow(hWnd, nCmdShow);
// UpdateWindow(hWnd);
return TRUE;
}
doesn't work as i wanted. pressing windows key brings up the taskbar and start menu. from there task manager can be opened. pressing Ctrl+Alt+Delete also brings up the task manager on the top of my window. i think i need to handle those keys such that they will be consumed by my program. i didn't program, but i know one way - hooking a dll. is there any other way?
usecase:
my program will be one of the startup process. so after logging in, it will not allow any other program to be foreground program. it will ask for a password. a valid password will close the window. believe it or not, sometimes i feel that i need such a software. there may be such software available freely to use, but i want to build my own. i'm a basic win32 programmer. i want to learn such advanced features of the api.
thanks for your time.
~Donotalo()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|