Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form Active Title Bar Color
Message
From
04/05/2004 05:03:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
03/05/2004 21:18:50
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00900529
Message ID:
00900623
Views:
66
>Hi Dawa
>
>The code worked on VFP 8.0 . Thanks alot.
>
>I have another application on VFP 6.0, for the code to work I need to get the forms window handle using the _WhToHwnd API function.
>I read about that fuction and still I did not know how to run it. Do you know how to fill the gap for the following code:
>
>
> IF VERSION(5) < 700
> *-- Need to get the forms window handle
> ELSE
> THIS.nHwnd = THIS.HWnd
> ENDIF
>
>
>Thanks
>
>Bob
>
>PS.
>
>My main problem is to change color of my form's Active title bar without doing any changes to my Windows Desktop appearance. Any suggestions

Oh you already found similar code. This version works in versions older than 7 (removing titlebar is easy, skipping) :
LOCAL loForm

loForm = Createobject("oForm")
loForm.Show
IF type('version(5)') = 'U' or version(5)/100 < 7
  SET library to home()+'foxtools.fll'
  loForm.nHwnd = _WhToHwnd(_WGetPort())
  SET library to
ELSE
  loForm.nHwnd = loForm.hWnd
ENDIF

READ Events

DEFINE Class oForm As Form
  nHwnd = 0
  TitleBar = 0
  Width = 750
  Height = 400
  nHwnd = 0

  ADD Object myTitle As Label ;
    with BackColor = Rgb(0,255,255), ;
    ForeColor = Rgb(255,0,0),;
    Caption = "I'm your form title", ;
    height = 25, Width = 750,;
    FontSize = 14, Alignment = 1
  ADD Object myExit As CommandButton With ;
    Caption = 'x', FontName='Wingdings',;
    Height = 25, Width = 27, Left = 0

  PROCEDURE Init()
  DECLARE ReleaseCapture In win32API
  DECLARE Integer SendMessage In win32API ;
    integer HWnd, Integer wMsg, ;
    integer wParam, Integer Lparam
ENDPROC

  PROCEDURE myTitle.MouseMove
  LPARAMETERS nButton, nShift, nXCoord, nYCoord
  ReleaseCapture()
  IF nButton = 1
    SendMessage(Thisform.nHwnd, 0x112, 0xF012, 0x0)
  ENDIF
ENDPROC

  PROCEDURE myExit.Click
  Clear Events
  thisform.Release
ENDPROC
ENDDEFINE
PS: Though this is doable IMHO do not play with windows standards.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform