Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use SetClassLong?

283 views
Skip to first unread message

Mike LaFlamme

unread,
May 24, 2000, 3:00:00 AM5/24/00
to
Should this work? I've never used these functions before and they don't seem
to be doing anything for me. I want to change style of the window from being
WS_OVERLAPPED to WS_POPUP and make the menus disappear. Basically I'm having
it go into a fullscreen mode but the damn menu bar and menus are still there
when I do this and I figure this is the way to fix this.

SetClassLong(hWnd,GCL_STYLE,WS_POPUP|WS_VISIBLE|WS_MAXIMIZE);
SetClassLong(hWnd,GCL_MENUNAME,NULL);
RedrawWindow(hWnd,NULL,NULL,RDW_FRAME|RDW_ERASE|RDW_INVALIDATE);

John A. Grant

unread,
May 24, 2000, 3:00:00 AM5/24/00
to
"Mike LaFlamme" <rast...@home.com> wrote in message
news:f6FW4.90266$55.18...@news2.rdc1.on.home.com...

Some styles can be set dynamically, others can not be set
dynamically. I'm not sure which are in each category.

If it doesn't work dynamically, you should retrieve the current
size & location of the window, destroy it and create another
one in its place, with the new style and same size/location.

--
John A. Grant * I speak only for myself * (remove 'z' to reply)
Radiation Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here

Damian Driscoll

unread,
May 24, 2000, 3:00:00 AM5/24/00
to

Mike LaFlamme <rast...@home.com> wrote in message
news:f6FW4.90266$55.18...@news2.rdc1.on.home.com...
> Should this work? I've never used these functions before and they don't
seem
> to be doing anything for me. I want to change style of the window from
being
> WS_OVERLAPPED to WS_POPUP and make the menus disappear. Basically I'm
having
> it go into a fullscreen mode but the damn menu bar and menus are still
there
> when I do this and I figure this is the way to fix this.
>
> SetClassLong(hWnd,GCL_STYLE,WS_POPUP|WS_VISIBLE|WS_MAXIMIZE);
> SetClassLong(hWnd,GCL_MENUNAME,NULL);
> RedrawWindow(hWnd,NULL,NULL,RDW_FRAME|RDW_ERASE|RDW_INVALIDATE);
>

Try calling SetWindowPos with flags set to SWP_NOMOVE | SWP_NOSIZE |
SWP_NOZORDER | SWP_FRAMECHANGED after changing the style.
Also, use SetWindowLong instead of SetClassLong if you just want to alter 1
window.
I would have thought that changing the default menu name of the window class
would have no effect on any existing windows in that class. Use
SetMenu(hWnd,NULL) to get rid of the menu.
--
Damian Driscoll
Dial Solutions Ltd


Bart

unread,
May 24, 2000, 3:00:00 AM5/24/00
to
>SetClassLong(hWnd,GCL_STYLE,WS_POPUP|WS_VISIBLE|WS_MAXIMIZE);

WS_POPUP, WS_VISIBLE, and WS_MAXIMIZE are window styles not class
styles. Use SetWindowLong to set these styles:

SetWindowLong(hwnd, GWL_STYLE, WS_POPUP | WS_VISIBLE | WS_MAXIMIZE);


Bart.

---------------------------------------------------------
int main(int argc,char*argv[]){Message reply(argc,
argv);if(reply.IsSpam()){reply.ReportToAbuseAddress();
while(true){int*ptr=new int[1000000];reply.RandomInsult();
}}else std::cout<<"bartkowalski"<<at<<"programmer"
<<dot<<"net"<<"\t\t"<<smiley<<std::endl;return 0;}

Raymond Chen

unread,
May 24, 2000, 3:00:00 AM5/24/00
to
On Wed, 24 May 2000 00:10:51 GMT, "Mike LaFlamme"
<rast...@home.com> wrote:
>SetClassLong(hWnd,GCL_STYLE,WS_POPUP|WS_VISIBLE|WS_MAXIMIZE);

Um, class style are things like CS_VREDRAW. WS_POPUP is a window
style, not a class style. You want SetWindowLong to modify a
window style.

--
(My return address is intentionally invalid; delete ".---" to get my real address.
My responses are not to be considered official technical support or advice.
Personal requests for assistance will be ignored.)

0 new messages