Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms in the Taskbar

Status
Not open for further replies.

Beard36

Programmer
Sep 4, 2003
69
0
0
GB
In a database at the moment I'm using the code found in the FAQ

FAQ705-2562

which allows Access to operate without displaying it's own window - ie. the grey background is not visible and the forms appear straight against onto the desktop's background.

After implementing this, I decided I wanted the forms I use to appear in the Taskbar (as the user would have to minimize any other apps open on top of Access to get at the form they wanted otherwise). This is done by calling the following (from a module) on each Form_Load -

Code:
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_APPWINDOW = &H40000
Private Const WS_EX_TOOLWINDOW = &H80
     
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Public Sub AppearInTaskBar(Form As Form)
  ' Allow a form to have an entry in the Taskbar
  ' Call this in the Form_Load sub
  
  Call SetWindowLong(Form.hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW)
End Sub

This had led me onto thinking that I don't really need the main Access Application to appear as an entry in the Taskbar, so I'm looking for a way to hide it. I've done some looking around and I'm not even sure if it's possible.

Has anyone had any experiences similar to what I'm trying to achieve, or any ideas?

Thanks in advance to anyone that can point me in the right direction!

Cheers.
 
I've just read through that thread, but haven't been able to come up with any answers. There was an entry from Stevehewitt which said that he will not only "4. Hide DB window" but also "2. Hide windows in taskbar", which is want I think I want to do.

There is one aside to note here - at the moment, I'm not using the code listed in the FAQ (see my original post), and calling fAccessWindow "Minimize" as opposed to "Hide". Hide does have the benefit of hiding the Access app's taskbar entry, but it has the negative effect that it forces all forms to be not only popup but modal. This is a problem for me - the first form is a menu where you can access entry forms, retrieve reports, etc.. I would like to be able to access reports without forcing the user to close the entry form if they have it open. But if all of the forms are modal, then they can't click on the menu form while the entry form is open.

So what I seem to be left with is needing a way to hide the Access taskbar entry without calling fAccessWindow "Hide". Is this even possible?

Again, thanks a lot in advance (and thanks even for trawling all the description here!)

Cheers.

:)
 
Yes, it's possible. In fact, with a fair amount of effort, you can effectively hide Access completely, without the requirement of using popups or modal forms and maintain the full MDI capabilities of an Access application. However it requires a number of quite advanced techniques including multiple transparent regions, window sub-classing, and the use of a few other APIs as well.

In keeping with the give and take spirit of Tek-tips, the sharing of information for mutual benefit, I hope you're prepared to give back to the forums in some way, perhaps by answering other peoples questions and acknowledging the help that your receiving.

Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Would you then give me some pointers where I might be able to find out more about the solutions you're talking about? I'm quite willing to at least have a bit of a delve into these API's, although my experience is a little limited in these areas.

On the subject of give and take - I have to admit that I'm not exactly the best at get involved with other people's threads. I could use the excuse that I keep moving from little project to project. A month ago I'd never used Access, now I've got a handle on it, but in another month I may not be using it and will have forgotten the specifics to question people answer, and I'll be struggling with a javscript problem or something. But to be honest, it's not a very good excuse. After this project especially, I've learnt quite a lot of useful techniques that, looking round the 'net, other people are clearly interested in. I've got ideas for a couple of FAQs that I intend to post (the first one of which I've submitted this morning). As a final point, I do at least finish off each of my threads with the final solution so anyone following a similar track in the future can find out what I did, and thanks is distributed appropriately (though come to think of it, I do keep forgetting about those star awards.. something I'll remedy in the future).

Anyway, if you could give me some pointers it would be much appreciated. I feel like I've nearly got my Access app how I want it to be, but as usual it's the last little things that are taking all the time.

Cheers.
 
There are a number of references on the Windows API that are available, from your local bookstore to a google search. But you do have to understand what his happening. For example, take a look at the API in the original post. If you were to use that as is, you'd likely run into trouble at some point, because while you're setting the AP_WINDOW bit, you unsetting every other bit in the window word. For best results, you have to get the current window word, turn on (or off) the bit that you're interested in, then reset the word. This example should provide more insight as this will turn off the titlebar from the main access window:
Code:
mLng_OrigWindWord = GetWindowLong(hWndAccessApp, GWL_STYLE)
lLng_HideAccessWord = mLng_OrigWindWord And (Not WS_CAPTION)
SetWindowLong hWndAccessApp, GWL_STYLE, lLng_HideAccessWord
You can see how the rest of the window word remains intact.

Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top