Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

It(BringWindowToTop) works fine in Win2K. But it doesn't work on Win98.

Is there any alternative other than this api function?

 

Please help. :confused:

Posted

Still not working. It seems like I can't call any api function in Win98.

Here is the code:

 

Private Declare Function SetForegroundWindow Lib "user32.dll" (ByVal hwnd As System.IntPtr) As Integer

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim cal As New Process

cal.StartInfo.FileName = "C:\Program Files\calc.exe"

cal.Start()

SetForegroundWindow(cal.MainWindowHandle)

Application.Exit()

end Sub

 

Anyway, thanks for your suggestion.

Posted
SetForegroundWindow returns a bool

what was the return value when u called it?

 

It returns nothing(neither true nor false).

 

Here is the error message:

 

System.PlatformNotSupportedException: Feature requires Windows NT.

at System.Diagnostics.ProcessManager.GetProcessIdFromHandle(IntPtr processHandle)

Posted
That means you cannot use the Process class in the way you are from Windows 98. It doesn't have anything to do with the API you're using.

 

But "calc.exe" did start. Do you mean process handle can't be used in Win98?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...