Board index » cppbuilder » Hide Application
oLiVeS
![]() CBuilder Developer |
oLiVeS
![]() CBuilder Developer |
Hide Application2005-10-22 07:38:21 AM cppbuilder38 How can I hide my application from the ALT+TAB feature to toggle between programs in Windows? |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-10-22 10:21:15 AM
Re:Hide Application
"oLiVeS" <olives3#Remove#@earthlink.net>wrote in message
QuoteHow can I hide my application from the ALT+TAB feature to WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { DWORD dwExStyle = GetWindowLong(Application->Handle, GWL_EXSTYLE); dwExStyle |= WS_EX_TOOLWINDOW; SetWindowLong(Application->Handle, GWL_EXSTYLE, dwExStyle); //... } However, do note that this approach removed the application's default taskbar button as well. Gambit |
oLiVeS
![]() CBuilder Developer |
2005-10-22 06:04:16 PM
Re:Hide ApplicationQuoteUse SetWindowLong() to give the TApplication::Handle the WS_EX_TOOLWINDOW QuoteHowever, do note that this approach removed the application's default {smallsort} |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-10-24 01:47:07 AM
Re:Hide Application
"oLiVeS" <olives3#Remove#@earthlink.net>wrote in message
QuoteIt does remove the taskbar button but I can still Alt+Tab to the program. instead of the TApplication window. What is your EXACT setup? Gambit |
oLiVeS
![]() CBuilder Developer |
2005-10-24 04:20:35 PM
Re:Hide ApplicationQuoteToolWindows cannot appear in the Alt-Tab dialog. If you still see our app shows up in the Alt+Tab list; however, it now has a titlebar and it's not what I want. The program Just shows some small brief info on a bsNone dialog then animates off the screen so I don't want a titlebar so the user can drag it elsewhere on the desktop. //-------------------------------------------------------------------------- - Ok I changed the BorderStyle to bsDialog and added the following code to remove the Caption because it wouldn't remove it with the bsToolWindow option. .h private: // User declarations void __fastcall CreateParams(TCreateParams &Params); .cpp void __fastcall TMain::CreateParams(TCreateParams &Params) { TForm::CreateParams(Params); // call base class first Params.Style &= ~WS_CAPTION; // then clear caption bit } |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-10-25 01:59:10 AM
Re:Hide Application
"oLiVeS" <olives3#Remove#@earthlink.net>wrote in message
QuoteI changed the BorderStyle from bsNone to bsToolWindow and it Quoteand it's not what I want. QuoteThe program Just shows some small brief info on a bsNone dialog returns HT_CAPTION then change the message result to HT_CLIENT instead. Gambit |