How to Programmatically Hide and Unhide the Windows Taskbar
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 295   1
URL.หัวข้อ / URL
How to Programmatically Hide and Unhide the Windows Taskbar

มีคนถามไว้ที่ http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=acc&Number=209476&page=0&view=expanded&sb=5&o=0&fpart= 
 
เขาต้องการที่จะซ่อน Taskbar เวลาเปิดเข้าโปรแกรมที่เขาพัฒนาขึ้นมาโดยใช้ Access และให้แสดง Taskbar กลับคืนเมื่อออกจากโปรแกรม 
 
ลองเข้าไปดูที่เว็บของ Microsoft ที่ http://support.microsoft.com/default.aspx?scid=kb;en-us;202099 
 
เป็น API Function ที่สามารถใช้ได้กับ Access97 ด้วย 
 
โค้ดมีดังนี้ครับ 
 
Dim handleW1 As Long 
 
Private Declare Function FindWindowA Lib "user32" _ 
   (ByVal lpClassName As String, _ 
   ByVal lpWindowName As String) As Long 
 
Private Declare Function SetWindowPos Lib "user32" _ 
   (ByVal handleW1 As Long, _ 
   ByVal handleW1InsertWhere As Long, ByVal w As Long, _ 
   ByVal x As Long, ByVal y As Long, ByVal z As Long, _ 
   ByVal wFlags As Long) As Long 
 
Const TOGGLE_HIDEWINDOW = &H80 
Const TOGGLE_UNHIDEWINDOW = &H40 
 
Function HideTaskbar() 
   handleW1 = FindWindowA("Shell_traywnd", "") 
   Call SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_HIDEWINDOW) 
End Function 
 
Function UnhideTaskbar() 
   Call SetWindowPos(handleW1, 0, 0, 0, 0, 0, TOGGLE_UNHIDEWINDOW) 
End Function 
 
ให้เปิด module ใหม่ในแถบ Module แล้ว Paste ขึ้นข้างบนลงไปครับ 
 
*** Edited by Supap Chaiya *** 26/4/2546 14:39:02

1 Reply in this Topic. Dispaly 1 pages and you are on page number 1

1 @R06657
   
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0474s