| | | Forum Newbie
       
Group: Forum Members Last Login: 12/15/2007 10:07:33 AM Posts: 2, Visits: 5 |
| The next code works in XP but not in Windows Vista:
In XP execute the calculator (hide)
but in windows vista show the window's calculator.
I tried in Windows Vista as administrator, but I get the same result.
Please, help me.
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation _
As String, ByVal lpFile As String, ByVal lpParameters _
As String, ByVal lpDirectory As String, ByVal _
nShowCmd As Long) As Long
Private Sub Form_Load()
ShellExecute hwnd, "open", "C:\windows\system32\calc.exe", vbNullString, vbNullString, vbhide
End Sub
|
| | | | 
Forum God
       
Group: Forum Members Last Login: Today @ 11:19:17 AM Posts: 1,795, Visits: 4,572 |
| I've replied to your other topic in the main VB forum. 
Keithhttp://www.martin2k.co.uk/forums/index.php?act=idx I've been programming with VB for 14 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning. |
| | | | 
Forum God
       
Group: Forum Members Last Login: Today @ 11:19:17 AM Posts: 1,795, Visits: 4,572 |
| Welcome to A1vbcode simrita.  simrita (9/30/2008) The next code works in XP but not in Windows Vista:
Shell "c:\windows\system32\calc.exe", vbHide
In XP execute the calculator (hide) but in windows vista show the window's calculator.
Private Sub Form_Load() ShellExecute hwnd, "open", "C:\windows\system32\calc.exe", vbNullString, vbNullString, vbhide End Sub
You don't need to full path to Calc.exe because its in the Windows path. Shell "calc.exe", vbHide According to this. You can not hide the calculator in either XP or Vista with Shell or ShellExecute. 
Keith http://www.martin2k.co.uk/forums/index.php?act=idx I've been programming with VB for 14 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning. |
| | | | Forum Newbie
       
Group: Forum Members Last Login: 5/7/2010 2:48:37 AM Posts: 1, Visits: 1 |
| That's nice work man..
Thank you for sharing this with us....
May Lord bless you ...
BORROWS |
| |
|
|