Mike (mgagnon) kindly posted the below code for me sometime ago which hides the taskbar when you start up and allows it to reappear when your done!
(Thanks again to Mike....)
The actual thread can be found at thread184-510903 but just in case, here's the code:
*To turn off the taskbar use this at the start of your code
* Code written by Eric den Doop
MESSAGEBOX("Click OK to hide the taskbar"
HideTaskBar()
FUNCTION HideTaskBar
DECLARE LONG FindWindow IN "user32" STRING lpClassName, STRING lpWindowName
DECLARE LONG SetWindowPos IN "user32" LONG hWnd, LONG hWndInsertAfter, LONG x, LONG Y, LONG cx, LONG cy, LONG wFlags
#DEFINE WINDOWHIDE 0x80
#DEFINE WINDOWSHOW 0x40
LOCAL lnHandle
lnHandle = FindWindow("Shell_TrayWnd", ""
SetWindowPos(lnHandle, 0, 0, 0, 0, 0, WINDOWHIDE)
ENDFUNC
*To turn it back on again use this code when your ready to quit to your APP
SHOWTASKBAR()
FUNCTION ShowTaskBar
DECLARE LONG FindWindow IN "user32" STRING lpClassName, STRING lpWindowName
DECLARE LONG SetWindowPos IN "user32" LONG hWnd, LONG hWndInsertAfter, LONG x, LONG Y, LONG cx, LONG cy, LONG wFlags
#DEFINE WINDOWHIDE 0x80
#DEFINE WINDOWSHOW 0x40
LOCAL lnHandle
lnHandle = FindWindow("Shell_TrayWnd", ""
SetWindowPos(lnHandle, 0, 0, 0, 0, 0, WINDOWSHOW)
ENDFUNC
Good luck and kindest regards
KB
When everything else is said and done, there will be nothing else to say or do
This option is "full of danger" but the code works and is very neat! In a quick test, it does not block {Ctrl-Esc} to bring up the menu if my code goes bad and craps out before setting the taskbar back on.
Could you tell us WHY you need to disable the start button? This information is important in ascertaining what is the appropriate and best solution to your problem. thanks.
I have to disagree with your comments: "This option is "full of danger" but the code works and is very neat! In a quick test, it does not block {Ctrl-Esc} to bring up the menu if my code goes bad and craps out before setting the taskbar back on"
Have you considered error testing your app before adding this code to it? It works fine for every one I know
KB
By the way, is there an alternative for the term "craps out"? I take it you mean "Crashes" :>
When everything else is said and done, there will be nothing else to say or do
For me, I am one of the unfortunate ones that are unable forcast just what a user will do once I place my app out into the world, this being said A forum by it's definition is a disscussion where one may take or leave anything that is stated as opinion. Again in my opnion altering the functionality of the OS for the gain of my Application is a slippery slope I "choose" to not go down. Like yourself I am always keeping busy and choose to support when ever I can. Yes there are others I choose to use "Coughs up blood", "Stops working the way I want", "Errors Out" and I am sure many others, this by the way would be a nice topic "Acceptable terminology for Crash"
When everything else is said and done, there will be someone with a different opinion.
Hi All,
the codes work.
Did I missed out anything as when I pressed the window button, the start menu appears although the taskbar is disabled.
thanks!
Yes, it was sometime ago and solved the problem for me (and thanks again)
To Steveb7
I'm glad you mentioned "this being said A forum by it's definition is a disscussion" so with that in mind, when all the code is available to every VisFox user, then there wouldn't be a need for the Tek-Tips forum
(Now wouldn't that be a disaster?)
Take care all
KB
When everything else is said and done, there will be nothing else to say or do
remsor (Programmer)
This is a real problem. I've hidden the button, disabled it but still that windows key keeps showing the Start form. Seems that it's no way to achieve this. And Foxpro doesn't seem to have a code for the "windows" key.
Could give a keyboard without the windows keys to your costumers ? (just a joke)
But now, getting serious, this keyboard key must be disabled someway.
Though I didn't find that special way .
Regards
As I go deeper the road seems to go further. We're just simply pasangers on the road of knowledge.
Mike
WinGuide is allays on my desktop but this solution that it gives it doesn't solve all the problem. I presume that he want's to disable the Start button quickly not to wait for a windows restart to enable/disable this option. And it's very dangerous also to deal with registry settings when we talk about the OS.
But as it rised my interest too I shall ... try ... But not now! Must look further. There must be a more "clean and safe" solution.
Maybe .... or maybe not ?!
Refards
As I go deeper the road seems to go further. We're just simply pasangers on the road of knowledge.
I would like to repost the question raised by slighthaze "Could you tell us WHY you need to disable the start button? This information is important in ascertaining what is the appropriate and best solution to your problem. thanks." Since every problem has potentially an infinite number of solutions. With any number being a completly different approach.
I can see an instance for example, we have an employment center near where I live that has a computer for the public to access to see jobs available, and the box is lockup up, but I can see some smart people wanting to shut that computer down using the start button, just for something to do.
Mike Gagnon
If you want to get the best response to a question, please check out FAQ184-2483 first.
Hi! My code showed up while searching Google for other things. The article in the FAQ section on our web site that discusses the code to show and hide the task bar also discussese a way to remove the start button. Just wanted to share this with you here. Note: you need to reboot Windows to get the start button again. Also note that you can still log off from windows using the Ctrl+Alt+Del key combination.
FUNCTION RemoveStartButton
DECLARE LONG FindWindow IN "user32" STRING lpClassName, STRING lpWindowName
DECLARE LONG SendMessage IN "user32" LONG hWnd, LONG wMsg, LONG wParam, LONG lParam
DECLARE LONG FindWindowEx IN "user32" LONG hWnd1, LONG hWnd2, STRING lpsz1, STRING lpsz2
#DEFINE WM_CLOSE 0x10
SendMessage(FindWindowEx(FindWindow("Shell_TrayWnd", "", 0x0, "Button", .NULL.), WM_CLOSE, 0, 0)
ENDFUNC
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.