Delphi to VB Translation (Hide/Show Start Button)

Show/ Hide the 'Start' button


The following procedure hides or shows the start button:




Procedure hideStartbutton (visi: boolean);

Var

Tray,

Child : HWnd;

c : Array [0..127] Of Char;

s : String;

Begin { hideStartButton }

Tray := FindWindow ('Shell_TrayWnd', Nil);

Child := GetWindow (Tray, GW_CHILD);

While Child <> 0 Do

Begin

If GetClassName (Child, c, SizeOf (c)) > 0 Then

Begin

s := StrPas (c);

If UpperCase (s) = 'BUTTON' Then

Begin

// IsWindowVisible(Child)

startbutton_handle := Child;

If visi Then

ShowWindow (Child, 1)

Else

ShowWindow (Child, 0)

End

End;

Child := GetWindow (Child, GW_HWNDNEXT)

End

End; { hideStartButton }


I am not a Delphi Programmer, and need your help on

translating the above source code to visual basic

equivalent. Windows API call is not a problem,

the problem is the function called "StrPas" at the

line "s := StrPas (c);", and I don't understand what

it does!! Can someone help me on this!! Thanks a lot!




Comments

  • : Show/ Hide the 'Start' button


    : The following procedure hides or shows the start button:


    :

    : Procedure hideStartbutton (visi: boolean);

    : Var

    : Tray,

    : Child : HWnd;

    : c : Array [0..127] Of Char;

    : s : String;

    : Begin { hideStartButton }

    : Tray := FindWindow ('Shell_TrayWnd', Nil);

    : Child := GetWindow (Tray, GW_CHILD);

    : While Child <> 0 Do

    : Begin

    : If GetClassName (Child, c, SizeOf (c)) > 0 Then

    : Begin

    : s := StrPas (c);

    : If UpperCase (s) = 'BUTTON' Then

    : Begin

    : // IsWindowVisible(Child)

    : startbutton_handle := Child;

    : If visi Then

    : ShowWindow (Child, 1)

    : Else

    : ShowWindow (Child, 0)

    : End

    : End;

    : Child := GetWindow (Child, GW_HWNDNEXT)

    : End

    : End; { hideStartButton }


    : I am not a Delphi Programmer, and need your help on

    : translating the above source code to visual basic

    : equivalent. Windows API call is not a problem,

    : the problem is the function called "StrPas" at the

    : line "s := StrPas (c);", and I don't understand what

    : it does!! Can someone help me on this!! Thanks a lot!


    s is the str value of the ANSI char values of c

    During the While...Do, s is checked for a returned c value of 'BUTTON'





Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories