hide from alt+tab

Byak@

Active Member
Licensed User
how can i do it?
i'm use FormEXDesctop libmy form hasn't got a borders.paratmetr showintaskbar=false hide my form from taskbar but not from alt+tab
i'm can set border style as FixedToolWindow.it is hide form from alt+tab but i don't want see title and borders!
i'm found code for hiding title for VB
B4X:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
        Dim oRegion As New Region(New Rectangle(20, 20, 100, 100)) 
        Me.Region = oRegion 
    End Sub
but how can i do it in Basic4ppc?
 
Last edited:

Byak@

Active Member
Licensed User
and
[FONT=&quot]
  1. Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
  2. ByVal nCmdShow As Long) As Long
  3. Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _
  4. ByVal wCmd As Long) As Long
  5. Const SW_HIDE = 0
  6. Const GW_OWNER = 4
  7. Private Sub Form_Load()
  8. Dim OwnerhWnd As Long, ret As Long
  9. Form1.Visible = False
  10. OwnerhWnd = GetWindow(Me.hwnd, GW_OWNER)
  11. ret = ShowWindow(OwnerhWnd, SW_HIDE)
  12. End Sub
[/FONT]
 

agraham

Expert
Licensed User
Longtime User
i'm found code for hiding title for VB ... but how can i do it in Basic4ppc?
objx are Door library Objects, args is a Door library ObjectArray.
B4X:
   obj1.New1(False)
   obj2.New1(False)
   obj3.New1(False)
   obj1.Value = Formex1.ControlRef
   args.New1(4)
   args.SetValue(0, 20, "System.Int32")
   args.SetValue(1, 20, "System.Int32")
   args.SetValue(2, 200, "System.Int32")
   args.SetValue(3, 200, "System.Int32")
   obj2.CreateNew2("System.Drawing.Rectangle" & obj2.System_Drawing, args.Value)
   args.New1(1)
   args.SetObject(0, obj2.Value) 
   obj3.CreateNew2("System.Drawing.Region" & obj2.System_Drawing, args.Value)
   obj1.SetProperty2("Region", obj3.Value)
 

eww245

Member
Licensed User
and
[FONT=&quot]
  1. Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
  2. ByVal nCmdShow As Long) As Long
  3. Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _
  4. ByVal wCmd As Long) As Long
  5. Const SW_HIDE = 0
  6. Const GW_OWNER = 4
  7. Private Sub Form_Load()
  8. Dim OwnerhWnd As Long, ret As Long
  9. Form1.Visible = False
  10. OwnerhWnd = GetWindow(Me.hwnd, GW_OWNER)
  11. ret = ShowWindow(OwnerhWnd, SW_HIDE)
  12. End Sub
[/FONT]



ShowWindow is in the dzHw library, along with A FindWindow method.

B4X:
SW_HIDE = 0
hWnd = dzhw.GetWindowHandle("#NETCF_AGL_BASE_","Form1")
dzhw.ShowWindow(hWnd,SW_HIDE)

Form.Visible = false can be done with Door library

B4X:
obj.FromControl("Form1")
obj.SetProperty("Visible",false)
 

Byak@

Active Member
Licensed User
eww245 no)form must be visible but not in alt+tab

this sample work right,thanks to agraham
 

Attachments

  • HideFromAltTab.zip
    606 bytes · Views: 191
Top