Page 1 of 1

how do i change the window style using windows api!??!

Posted: Thu Jun 30, 2005 6:02 am
by doodlemunch
hi im trying to change a window style i just want the window title to show up no minimize and no close bottons if you get what i mean im trying to use SetWindowLong_() but i do not know whitch flags to send in because when i try to send #WS_EX_APPWINDOW only it was a mess there was no titlebar and i coulnt use the window that was in #GWL_EXSTYLE mode
i am not creatting this win i just want to change its style but how can i do that??? say with the windows calculator thanks!!!

Posted: Thu Jun 30, 2005 12:04 pm
by GreenGiant
Try running this

Code: Select all

OpenWindow(0,0,0,400,400,#PB_Window_ScreenCentered,"Title")

Delay(3000)
No close/minimise buttons in the corner :)

Posted: Thu Jun 30, 2005 9:44 pm
by doodlemunch
thanks but i think i said i aint creating the window in fact i said how would i apply this to the windows calculator ?

and if you create your window with the winapi you wont be able to use any #PB_Window_ constant i think but what i want to do is change a current opened window´s style its an windows api question more than purebasic

Posted: Fri Jul 01, 2005 9:10 am
by GreenGiant
Ok then, more of a challenge :) This code's a bit messy (the minimising bit) but I was in a hurry. You should just be able to force the window to redraw.

Code: Select all

RunProgram("calc")
Delay(1000)

hWnd=FindWindow_(0,"Calculator")
style=GetWindowLong_(hWnd,#GWL_STYLE)
style=style!#WS_SYSMENU
SetWindowLong_(hWnd,#GWL_STYLE,style)
CloseWindow_(hWnd)
ShowWindow_(hWnd,#SW_RESTORE)

Delay(2000)

Posted: Sat Jul 02, 2005 12:20 am
by doodlemunch
just what i wanted!!! thanks!!!! is it possible to leave only the minimize botton??