borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Translating from Spanish to English Vice Versa)Next Topic (How to find windows which r minimized to the system tray (FindWindow)?) New Topic New Poll Post Reply
AndreaVB Forum : API : API to set colors on Access 2000 app
Poster Message
tizziebird
Level: Guest


icon API to set colors on Access 2000 app

I've used Tip090003 to change the title bar (active caption) colors (SET OR READ THE CURRENT USER DESKTOP COLOR SETTINGS); however, this changes the colors on all applications ... i need to do it on only my access 2000 db application, leaving all other applications set to the user's color scheme ... any ideas?  i'm new to API functions and have spent hours searching google for an answer, but all i can come with is changing the windows colors, not simply the application colors.

[Edited by tizziebird on 25-10-2004 at 09:05 PM GMT]

[Edited by tizziebird on 25-10-2004 at 11:13 AM GMT]

25-10-2004 at 04:04 PM
| Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: API to set colors on Access 2000 app

As it is said, it SETS OR READS THE CURRENT USER DESKTOP COLOR SETTINGS, where cuurent user means current windows user, not user of your application. To change appearance of your application windows only, you would need to suclass a form. This way you tell OS that you will draw a form by yourself, and then you can change form shape, its color, buttons 0 client and non-client areas.... IF you dont know anything about subclassing,  then maybe it is the best to search for some code on the net, so you can implement it in your application. There are some rules about subclassing which must be followed in order your app and OS to be safely running (or else you will receive GPF's). There are also many examples on this site and many subclassing tutorials on  the net, which can give you basic idea how subclassing works.

____________________________
If you find the answer helpful, please mark this topic as solved.

25-10-2004 at 04:54 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: API to set colors on Access 2000 app

Hi tizziebird,
It is possible to set the non-client area of the window (titlebar)to include text and background colour of your choice. But it involves a lot of API calls!
You have to first get the window's rectangle using GetWindowRect(). Then get the DC (Device Context) of the Window by calling GetWindowDC()
Use GetSystemMetrics() to compute the dimensions of the caption bar, then draw in response to the WM_NCPAINT, WM_NCACTIVATE, WM_SETTEXT, and WM_SYSCOMMAND messages. When processing these messages, you should first pass on the message to DefWindowProc() for default processing, then render the caption before returning from the message.

GOOD LUCK



____________________________
multi-tasking - the ability to hang more than one app. at the same time.

26-10-2004 at 02:27 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : API to set colors on Access 2000 app
Previous Topic (Translating from Spanish to English Vice Versa)Next Topic (How to find windows which r minimized to the system tray (FindWindow)?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder