How to lock taskbar in my program
-
As you know, we can lock taskbar manually, But I would like to lock taskbar by my own program. I try to do it by the following code: DWORD style = GetWindowLong(hShellTrayWnd,GWL_STYLE); style &= ~WS_SIZEBOX; SetWindowLong(hShellTrayWnd, GWL_STYLE, style); Unfortunately, it didn't work as I expected. Does anyone know how to do it? Your help would be greatly appreciated. Nothing impossible, Nothing sure
-
As you know, we can lock taskbar manually, But I would like to lock taskbar by my own program. I try to do it by the following code: DWORD style = GetWindowLong(hShellTrayWnd,GWL_STYLE); style &= ~WS_SIZEBOX; SetWindowLong(hShellTrayWnd, GWL_STYLE, style); Unfortunately, it didn't work as I expected. Does anyone know how to do it? Your help would be greatly appreciated. Nothing impossible, Nothing sure
I did do it sometime back but don't have the message number with me now. :doh: Maybe I can give it you tomorrow. This requires you to send a message to the taskbar asking it to lock itself. I did have the number but don't have it now. :)
Nibu thomas A Developer Programming tips[^] My site[^]
-
I did do it sometime back but don't have the message number with me now. :doh: Maybe I can give it you tomorrow. This requires you to send a message to the taskbar asking it to lock itself. I did have the number but don't have it now. :)
Nibu thomas A Developer Programming tips[^] My site[^]
Hi Tomas, Your help would be greatly appreciated, in fact I send WM+USER+336 to taskbar, but it didn't work, which make me feel that it can't be done by sending a message. And then I try another way below: CToolBar* trayWnd = (CToolBar*)FromHandle(hShellTrayWnd); DWORD barStyle = trayWnd->GetBarStyle(); barStyle |= CBRS_SIZE_FIXED; trayWnd->SetBarStyle(barStyle); It also didn't work, I was really frustrated, the style of taskbar vary every time even though I remove "trayWnd->SetBarStyle(barStyle)". For example, sometimes barStyle is 380, but sometimes it is 376, and other times, it is another value. it is very strange for me. Nothing impossible, Nothing sure
-
Hi Tomas, Your help would be greatly appreciated, in fact I send WM+USER+336 to taskbar, but it didn't work, which make me feel that it can't be done by sending a message. And then I try another way below: CToolBar* trayWnd = (CToolBar*)FromHandle(hShellTrayWnd); DWORD barStyle = trayWnd->GetBarStyle(); barStyle |= CBRS_SIZE_FIXED; trayWnd->SetBarStyle(barStyle); It also didn't work, I was really frustrated, the style of taskbar vary every time even though I remove "trayWnd->SetBarStyle(barStyle)". For example, sometimes barStyle is 380, but sometimes it is 376, and other times, it is another value. it is very strange for me. Nothing impossible, Nothing sure
NianHawk wrote:
Hi Tomas, Your help would be greatly appreciated, in fact I send WM+USER+336 to taskbar, but it didn't work, which make me feel that it can't be done by sending a message.
Thanks. This works on both Windows XP, 2000...
//custom message
#defineWM_USERDEF_LOCKTASKBAR
424static HWND hShellWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);
if(hShellWnd != NULL)
::PostMessage(hShellWnd, WM_COMMAND, MAKELONG(WM_USERDEF_LOCKTASKBAR
, 0), NULL);
else
hShellWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);This will work!:)
Nibu thomas A Developer Programming tips[^] My site[^]
-
NianHawk wrote:
Hi Tomas, Your help would be greatly appreciated, in fact I send WM+USER+336 to taskbar, but it didn't work, which make me feel that it can't be done by sending a message.
Thanks. This works on both Windows XP, 2000...
//custom message
#defineWM_USERDEF_LOCKTASKBAR
424static HWND hShellWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);
if(hShellWnd != NULL)
::PostMessage(hShellWnd, WM_COMMAND, MAKELONG(WM_USERDEF_LOCKTASKBAR
, 0), NULL);
else
hShellWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);This will work!:)
Nibu thomas A Developer Programming tips[^] My site[^]
It did work well, thank a lot. I have another question if you wouldn't feel disturbed, Actually I use spy to monitor taskbar, if my program send such WM_COMMAND msg to taskbar, spy can capture it. But if I do it manually by using winxp functionality, spy didn't show this msg, that is why I always can't get this msg. Could you be so kind to teach me something about it? Nothing impossible, Nothing sure
-
It did work well, thank a lot. I have another question if you wouldn't feel disturbed, Actually I use spy to monitor taskbar, if my program send such WM_COMMAND msg to taskbar, spy can capture it. But if I do it manually by using winxp functionality, spy didn't show this msg, that is why I always can't get this msg. Could you be so kind to teach me something about it? Nothing impossible, Nothing sure
NianHawk wrote:
It did work well, thank a lot.
You are Welcome :)
NianHawk wrote:
I have another question if you wouldn't feel disturbed,
Not at all.
NianHawk wrote:
Actually I use spy to monitor taskbar, if my program send such WM_COMMAND msg to taskbar, spy can capture it. But if I do it manually by using winxp functionality,
Which functionality!:~
NianHawk wrote:
Could you be so kind to teach me something about it?
Can you give me your email. I can send you a sample application, which demonstrates some useful messages related to the TaskBar. BTW here is a list if you are interested...
/*DisplayStartupMenu*/ 305,
/*DisplayRunDialog*/ 401,
/*DisplayLogoffDialog*/ 402,
/*ArrangeCascade*/ 403,
/*ArrangeTileHrz*/ 404,
/*ArrangeTileVrt*/ 405,
/*ShowDesktop*/ 407,
/*ShowDateTimeDialog*/ 408,
/*ShowTaskbarPrps*/ 413,
/*MinAll*/ 415,
/*MaxAll*/ 416,
/*ShowDesktop2*/ 419, /*Well you need to check this one. Make sure is this minimize all or show desktop.*/
/*ShowTaskMngr */ 420,
/*TaskBrCustomizeNtfy*/ 421,
/*LockTaskbar*/ 424,
/*HelpAndSuppCenter*/ 503,
/*ControlPanel*/ 505,
/*TurnOffCompDialog*/ 506,
/*PrintersAndFaxesDialog*/ 510,
/*FindFilesDialog*/ 41093,
/*FindComputers*/ 41094
Nibu thomas A Developer Programming tips[^] My site[^]
-
NianHawk wrote:
It did work well, thank a lot.
You are Welcome :)
NianHawk wrote:
I have another question if you wouldn't feel disturbed,
Not at all.
NianHawk wrote:
Actually I use spy to monitor taskbar, if my program send such WM_COMMAND msg to taskbar, spy can capture it. But if I do it manually by using winxp functionality,
Which functionality!:~
NianHawk wrote:
Could you be so kind to teach me something about it?
Can you give me your email. I can send you a sample application, which demonstrates some useful messages related to the TaskBar. BTW here is a list if you are interested...
/*DisplayStartupMenu*/ 305,
/*DisplayRunDialog*/ 401,
/*DisplayLogoffDialog*/ 402,
/*ArrangeCascade*/ 403,
/*ArrangeTileHrz*/ 404,
/*ArrangeTileVrt*/ 405,
/*ShowDesktop*/ 407,
/*ShowDateTimeDialog*/ 408,
/*ShowTaskbarPrps*/ 413,
/*MinAll*/ 415,
/*MaxAll*/ 416,
/*ShowDesktop2*/ 419, /*Well you need to check this one. Make sure is this minimize all or show desktop.*/
/*ShowTaskMngr */ 420,
/*TaskBrCustomizeNtfy*/ 421,
/*LockTaskbar*/ 424,
/*HelpAndSuppCenter*/ 503,
/*ControlPanel*/ 505,
/*TurnOffCompDialog*/ 506,
/*PrintersAndFaxesDialog*/ 510,
/*FindFilesDialog*/ 41093,
/*FindComputers*/ 41094
Nibu thomas A Developer Programming tips[^] My site[^]
Thanks for your help. I mis-thought there had not benn reply yet because I didn't receive the response mail as usual, maybe last time I missed to check "Notify me by e-mail if someone answers this message". My email is : NianHawk@invalid.hotmail.com (please discard "invalid"). Which functionality! ===> I just lock the taskbar by taskbar menu. Best regards. Nothing impossible, Nothing sure
-
Thanks for your help. I mis-thought there had not benn reply yet because I didn't receive the response mail as usual, maybe last time I missed to check "Notify me by e-mail if someone answers this message". My email is : NianHawk@invalid.hotmail.com (please discard "invalid"). Which functionality! ===> I just lock the taskbar by taskbar menu. Best regards. Nothing impossible, Nothing sure
NianHawk wrote:
Thanks for your help. I mis-thought there had not benn reply yet because I didn't receive the response mail as usual, maybe last time I missed to check "Notify me by e-mail if someone answers this message". My email is : NianHawk@invalid.hotmail.com (please discard "invalid").
Heh don't worry. I wrote an article on this subject. You can get the sample application from here[^]. Hope you will like it.
Nibu thomas A Developer Programming tips[^] My site[^]
-
NianHawk wrote:
Thanks for your help. I mis-thought there had not benn reply yet because I didn't receive the response mail as usual, maybe last time I missed to check "Notify me by e-mail if someone answers this message". My email is : NianHawk@invalid.hotmail.com (please discard "invalid").
Heh don't worry. I wrote an article on this subject. You can get the sample application from here[^]. Hope you will like it.
Nibu thomas A Developer Programming tips[^] My site[^]