Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Set Taskbar Autohide / Always-On-Top with code (Access 97)

    Hi All!
    I have an application in which i would like to set the windows taskbar auto-hide to true *or* always-on-top to false, then back again later. I would like the application to take up the whole screen while it is in use, then change back to the settings the user had previously. I have searched for help on how to do this, but have not been very successful.

    thanks in advance

    <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35> <img src=/S/mice.gif border=0 alt=mice width=50 height=25> Happy New Year!!! <img src=/S/mice.gif border=0 alt=mice width=50 height=25> <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35>

  2. #2
    Lounger
    Join Date
    Apr 2001
    Location
    Khon Kaen, Thailand
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)


  3. #3
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    Thanks for your reply
    I had checked that article out previously, and it did hide and show the taskbar, however it does not actually set the "auto-hide" or "always-on-top" property. I will admit, as i explained my problem earlier, it would seem that this article would solve it.

    I will attempt to explain the problem further... I am using a procedure that changes the resolution to 800x600. This is all fine and dandy except that after the resolution changes, the taskbar dissappears and the access window does not go all the way down to the bottom of the screen (it goes to the top of where the taskbar was). The only way that i have found to workaround the problem that is acceptable to me is when the "auto-hide" is set on or "always-on-top" is off. That way the access window extends all the way to the bottom of the screen. (the taskbar is still missing, but i am willing to sacrafice that). I want to be able to change either of those settings to be able to see the full screen, then change the setting back when the application closes.

    Hopefully this clarified my problem. If you have any different suggestions, please let me know.

    Thanks in advance

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    In general, it is a bad idea -- and extremely impolite -- to change a machine's settings from an application without the consent of the user. Yes, I know it is done and I even have programs on my machine that do it, but I don't like it and I won't do it to my users. All it takes is for something to go wrong in your app and the user is left with a condition they don't like and may not have any idea of how to remedy.
    Charlotte

  5. #5
    Lounger
    Join Date
    Apr 2001
    Location
    Khon Kaen, Thailand
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    Check this out in Google.com, http://www.google.co.th/search?q=set+taskb...&oe=UTF-8&hl=th

    And this, http://www.utteraccess.com/forums/showflat...on&Match=Entire Phrase&Searchpage=0&Limit=25&Old=1week&Main=113279 &Search=true#Post113403 for the screen resolution issue.

    Hope you will come up with sthg. for your problem.

  6. #6
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    <P ID="edit" class=small>(Edited by MarkD on 01-Jan-03 09:41. Clarification of how to unhide taskbar from Start menu.)</P>One way to do this is by hiding taskbar and then resizing form to full screen size using Windows API functions. To quote MSKB Article 197585, "There is no programmatic way to change the AutoHide property in Microsoft Windows. To size a Visual Basic form so that it fills the entire screen, including covering the taskbar if it is showing, you must explicitly set the height and width of the window." The attached zip file contains small sample database (converted to A97 format) that illustrates how to do this. The modTaskbar module contains the API functions and constant declarations used for this (too lengthy to post here; see attd file for code).

    In sample, the frmHWnd form calls MaxFullScreen sub using form's hWnd property:

    Private Sub FullScreen_btn_Click()
    MaxFullScreen (Me.hWnd)
    End Sub

    The form will be "maximized" to full size of screen, including space normally occupied by taskbar (form window is actually in "normal" (ie, restored) state). (Note: "hWnd" is a number (32 bit integer) used by Windows to keep track of all open windows; this number equates to a Long in VB.) Ensure taskbar is unhidden when form is closed:

    Private Sub Form_Close()
    UnhideTaskbar
    End Sub

    NOTE: I tried to resize Access application top-level window to full screen size using the Application hWndAccessApp property as hWnd parameter but did not work; the application window was resized, but taskbar space at bottom of screen was visible. So am not sure how you would implement this for application as a whole; it will work for individual forms.

    CAVEAT: I would second Charlotte's advice that users of your program may not appreciate this type of shenanigan if your application crashes & they are stuck with a hidden taskbar and no obvious way to unhide it. (In this event, you would press Windows key (or CTRL + ESC) to open Windows Start Menu, then right-click to open Taskbar & Start Menu properties dialog; if you check "Auto-hide the taskbar" option (or re-check if already set to AutoHide) the taskbar will appear again (this works in WIN XP).) If implementing this, ensure error handling included whenever taskbar is hidden to unhide taskbar if error occurs.

    NOTE: WIN API code used in attached db based in part on following MSKB articles:

    MSKB Art 197585 - HOWTO: Cover the Taskbar with a Window in Visual Basic

    MSKB Art 202099 - OFF2000: How to Programmatically Hide and Unhide the Windows Taskbar

    The standard disclaimers apply...

    HTH
    Attached Files Attached Files

  7. #7
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    Thanks Mark,
    I like the idea of resizing the app to cover the whole screen... however your attachment only resizes a form (unfortunately this will not work with the scheme of things i have set up.) The first link you gave me looks intriguing, however i cannot get the code to work. If there would be any way you could check the code out, that would be fantastic. I am not too adept at code dealing with api functions and such...

    I also agree with you and charlotte about not changing settings, but i am unsure of any other way to go around the problem... If either of you two have any other ideas, i am absolutely open to suggestions [img]/forums/images/smilies/ohmy.gif[/img])


    thanks a bunch

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    The simplest answer is redesign your form to fit 800X600 in the Access main window and forget about the Windows real estate. If you can't fit all your controls into that space, you have a worse problem with the form than just the screen resolution.
    Charlotte

  9. #9
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    Thanks Charlotte...

    So i guess you are saying to design it for 800x600 and let the forms and such for 1024x768 resolution be off center? I had toyed with that and really that is how it is set up, but things just look alot better if everyone is at the same resolution.
    Let me know if you meant something different. Thanks!

  10. #10
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    No, I'm saying design it for 800x600 and then test the resolution when your app opens. If it's 800x600, maximize the forms, otherwise don't maximize.
    Charlotte

  11. #11
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    As noted previously, I tried using code in MSKB article to resize Access application window to fill entire screen, including taskbar area, but did not seem to work. Also, the article sez the resized form will cover taskbar, but that did not work - if you did not hide taskbar, the form resized itself OK but taskbar remained visible on top of form.... [img]/forums/images/smilies/sad.gif[/img]

    Also at work today I experimented with this, we still use WIN 98, when I hid taskbar & minimized all open windows, I was NOT able to make taskbar visible again by resetting taskbar properties from Start menu (in WIN 98 w/taskbar hidden you have to press Windows key or CTRL + ESC to open Start Menu, then select "Settings", then Taskbar & Start Menu properties). Unlike WIN XP, setting "AutoHide" did not make taskbar visible again. So if you hide taskbar in WIN 98, & Access crashes or hangs up for some reason, the user will have no way to make taskbar visible again w/o rebooting - not good idea. So ideal solution would be to be able to resize application window to fill entire screen w/o having to hide or otherwise fool with taskbar properties.

    If I can figure out some smart way to do this will advise further....

  12. #12
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    Thanks Mark
    I appreciate your continued help <img src=/S/clever.gif border=0 alt=clever width=15 height=15>

  13. #13
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    Mark and Charlotte:

    I think i figured out an acceptable workaround... (and if this is something either of you hinted at but i didn't catch, i apologize). The reason i wanted to change screen resolution was so my forms were centered and look good on the screen. I accomplished this by figuring the width and height of the screen (5900x3900 twips @ 800x600). Then i set the calculated center of the form to the calculated center of the screen...

    What i have now decided to do was to simply check the computer's resolution, then change the calculated center depending on that screen resolution. It seems like a simple solution to the problem, but this is really all i was looking for in the first place <img src=/S/blush.gif border=0 alt=blush width=15 height=15> .

    Thank you both for your help!!

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    But why don't you set the AutoCenter property of the form to Yes/True in that case?

  15. #15
    2 Star Lounger
    Join Date
    May 2001
    Location
    indiana
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set Taskbar Autohide / Always-On-Top with code (Access 97)

    Hmm....

    The reason i didn't was because in the past, the auto-center property was not working correctly... However, since you said that, i tried it out. I found out that the auto-center does not work when you go from design view to form view (which was how i was testing the forms out). I just now tried it by opening the form from the database menu, and wouldn't you know it.. It worked! I guess that goes to show you that if something does not work how you would expect it to, take the time to find out why... Thanks for pointing that out Hans.. i kind of feel like an idiot now!! <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30>

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •