YDinopoulos Posted March 6, 2012 #1 Share Posted March 6, 2012 Καλησπερα Φτιαχνω για εναν πελατη ενα μικρο προγραμμα που θα εχει 3 κουμπια. 1) Internet Explorer 2) ενα αλλο προγραμμα 3) Εξοδος. Το προβλημα μου ειναι οτι οταν παταω το κουμπι 1 (ie) μου ανοιγει τον ie minimized κατω, ενω το θελω ειτε maximized, ειτε σαν παραθυρο.Παραθετω τον κωδικα που εχω φτιαξει (Υποψιν οτι οι γνωσεις μου ειναι σχεδον στο μηδεν, το εχω φτιαξει με ψαξιμ στο νετ...)Public Class Autostart Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Shell("start /max C:\Program Files\Internet Explorer\iexplore.exe") End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Shell("shutdown /l /f") End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Shell("E:\KEFALAIO\KEF32.EXE") End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged End SubEnd Class Link to comment Share on other sites More sharing options...
Wizard! Posted March 6, 2012 #2 Share Posted March 6, 2012 Για δοκίμασε αυτό:Private Sub MaximizeIE()For Each p As Process In Process.GetProcessesByName("iexplorer")ShowWindow(p.MainWindowHandle, 3)Next pEnd Sub Link to comment Share on other sites More sharing options...
YDinopoulos Posted March 6, 2012 Author #3 Share Posted March 6, 2012 Πως/που θα μπει αυτο ? Link to comment Share on other sites More sharing options...
nucleus Posted March 6, 2012 #4 Share Posted March 6, 2012 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Shell("start /max C:\Program Files\Internet Explorer\iexplore.exe") For Each p As Process In Process.GetProcessesByName("iexplorer") ShowWindow(p.MainWindowHandle, 3) Next p End SubΑυτό Link to comment Share on other sites More sharing options...
YDinopoulos Posted March 6, 2012 Author #5 Share Posted March 6, 2012 [MENTION=1215]nucleus[/MENTION] Το αντικατεστησα. Πηγα να κανω rebuid solution (σωστο?) και μου πεταξε το εξης error κατω κατω..Error 3 'ShowWindow' is not declared. It may be inaccessible due to its protection level. Link to comment Share on other sites More sharing options...
Wizard! Posted March 6, 2012 #6 Share Posted March 6, 2012 Για δοκίμασε να προσθέσεις αυτό στον κώδικά σου:Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmdShow As Integer) As Integer Link to comment Share on other sites More sharing options...
nucleus Posted March 6, 2012 #7 Share Posted March 6, 2012 προσθέτεις την εντολή include Windows.h πάνω πάνω στο αρχείο Link to comment Share on other sites More sharing options...
nucleus Posted March 6, 2012 #8 Share Posted March 6, 2012 Μάλλον δούλεψε Link to comment Share on other sites More sharing options...
YDinopoulos Posted March 6, 2012 Author #9 Share Posted March 6, 2012 Πεταει error: Declaration expectedΗ αρχη του κωδικα ειναι ετσι...include Windows.hPublic Class Autostart Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Shell("C:\Program Files\Internet Explorer\iexplore.exe") For Each p As Process In Process.GetProcessesByName("iexplorer") ShowWindow(p.MainWindowHandle, 3) Next p End Sub Link to comment Share on other sites More sharing options...
YDinopoulos Posted March 6, 2012 Author #10 Share Posted March 6, 2012 Τελικα δουλεψε με αυτο... Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click System.Diagnostics.Process.Start("C:\Program Files\Internet Explorer\iexplore.exe") End Sub Link to comment Share on other sites More sharing options...
nucleus Posted March 6, 2012 #11 Share Posted March 6, 2012 Αφού είναι VB θέλει import και όχι include δηλαδή Oopss!!Καλύτερα που απέφυγες την shell Link to comment Share on other sites More sharing options...
YDinopoulos Posted March 6, 2012 Author #12 Share Posted March 6, 2012 Ειναι παραξενο ομως, γιατι με την shell ανοιγω στο δευτερο κουμπι ενα αλλο προγραμμα και μου ανοιγει αμεσως φουλ σκριν! Link to comment Share on other sites More sharing options...
PaNick Posted March 6, 2012 #13 Share Posted March 6, 2012 Για δοκίμασε αυτό:Private Sub MaximizeIE()For Each p As Process In Process.GetProcessesByName("iexplorer")ShowWindow(p.MainWindowHandle, 3)Next pEnd SubΜη δίνετε σε παιδιά ..όπλα!Το αυτό και για τη χρήση του "windows.h" λίγο παρακάτω! Link to comment Share on other sites More sharing options...
YDinopoulos Posted March 6, 2012 Author #14 Share Posted March 6, 2012 WTF ? Link to comment Share on other sites More sharing options...
nucleus Posted March 6, 2012 #15 Share Posted March 6, 2012 Μη δίνετε σε παιδιά ..όπλα!Το αυτό και για τη χρήση του "windows.h" λίγο παρακάτω!Συντακτικά λάθη ftw πχ το include windows.h το οποίο είναι παντελώς λάθοςFor Each p As Process In Process.GetProcessesByName("iexplorer")ShowWindow(p.MainWindowHandle, 3)Next pΔεν χρειάζεται το p μετά το keyword Next Αυτα :baby: Link to comment Share on other sites More sharing options...
ApolloTonKosmo Posted March 6, 2012 #16 Share Posted March 6, 2012 αντι για shell μπορεις να δοκιμασεις και αυτοsystem.diagnostics.process.start() Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.