• Best of luck to the class of 2024 for their HSC exams. You got this!
    Let us know your thoughts on the HSC exams here
  • YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page
MedVision ad

Need t0o Maximize Window on VB (1 Viewer)

Kn1ght_M4r3

Member
Joined
Mar 3, 2003
Messages
332
Location
D o w n l o a d C o m p l e t e .....
Hi guys i just need to know if anyone out there knows how to maximise a vb window :confused: so that when i run the application, it will automatically maximise. I dont want to click on the maximise button i just want it to do it on its own.

Thanx. :D
 

Kn1ght_M4r3

Member
Joined
Mar 3, 2003
Messages
332
Location
D o w n l o a d C o m p l e t e .....
hey guyz faced another problem.
like wat i want to do is have a menu so when i click on it it will pop up a html page. i just need to know the code for the linking it somehow. Would the coding of this be similar to that of creating a HTML page?
something along the lines
<a href="http://www.metacrawler.com">whatevea</a>

im not to sure about how to go about it if u guyz can help thanx.
 

sunny

meh.
Joined
Jul 7, 2002
Messages
5,350
Gender
Male
HSC
2002
You can use the shellexecute api to launch programs and urls.

Code:
' api declaration in a module
Public 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
Public Const SW_SHOWNORMAL = 1

' and use this somewhere
ShellExecute Me.hWnd, vbNullString, urlVariable, vbNullString, "c:\", SW_SHOWNORMAL
 

Kn1ght_M4r3

Member
Joined
Mar 3, 2003
Messages
332
Location
D o w n l o a d C o m p l e t e .....
thanx buddy although i had to make a slight change to the declaration in the api module coz i didnt work with a public declare :

' api declaration in a module
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 Const SW_SHOWNORMAL = 1

' and use this somewhere
ShellExecute Me.hWnd, vbNullString, urlVariable, vbNullString, "c:\", SW_SHOWNORMAL


i could've left the Private Const SW_SHOWNORMAL = 1
as Const SW_SHOWNORMAL = 1 and it still worked.
but thanx buddy. =0) really appreciate your help
 

sunny

meh.
Joined
Jul 7, 2002
Messages
5,350
Gender
Male
HSC
2002
Any API, constant, UDT, and some other stuff can't be declared as public in object modules...being an object and making these kind of members public defeats the purpose of it being an object, so you can't declare them as public in your form code, but you can do it in standard modules.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top