From: Thomas, T. B <tim...@lm...> - 2001-01-11 15:36:42
|
Should I take that as a no? =20 -----Original Message----- From: tim...@lm... [mailto:tim...@lm...] Sent: Monday, January 08, 2001 11:47 AM To: per...@li... Subject: [perl-win32-gui-users] URL Link Object? Aldo or anyone else- Is there an object within Win32::GUI that will allow you to have a URL = link in a GUI-window? When you click on the text it should open up your = default browser and take you to that URL. You know, the kind that a lot = of Apps have in their About screen. Or is there another way to create = this effect? Thanks, Tim Thomas ------------------------------------------------------------------------= ------------------------- Tim Thomas Unix Systems Administrator Lockheed Martin EIS =B7 Denver Data Center 303-430-2281 mailto:tim...@lm... <mailto:tim...@lm...>=20 ------------------------------------------------------------------------= ------------------------- |
From: Sean H. <jal...@ho...> - 2001-01-11 16:22:06
|
Never tried it or even seen anything on it, but theoretically you should be able to grab the mouse position in the window, and if it falls within the bounds of the text which should be a link, open an external application. Some drawbacks: 1) You would have to change the mouse position range every time you changed the text (or else write a little something to find out the mouse position range of the text you want - but that would have to take into account font face, font size, and the length of the preceding string, and might be a little too complex to bother with. 2) You would have to write something to find the path of the default browser if you plan to distribute, as not everyone uses the same browser or keeps it in the same place. However, if you are going to use this only for yourself and not change the link text (or the text surrounding it), you could theoretically do this to make it work. >Is there an object within Win32::GUI that will allow you to have a URL link >in a GUI-window? When you click on the text it should open up your default >browser and take you to that URL. You know, the kind that a lot of Apps >have in their About screen. Or is there another way to create this effect? _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com |
From: Thomas, T. B <tim...@lm...> - 2001-01-11 16:59:03
|
Sean - thanks for your input. I hadn't thought of checking for the = mouse position. Your drawbacks are BIG drawbacks and definitely would = not be worth bothering with. I had thought of doing it with a button or some other action, but I = keep coming back to your drawback #2. How do I determine what the = default browser is and where it is located? There is a Win32::FileType = module where you can test file associations, but I couldn't seem to get = it to work. Theoretically wherever your .html is associated, that is = your default browser. I believe both IE and Netscape use this to check = to see if they are the default browser. Below is the code I have used to test out the Win32::FileType module, = any help would be appreciated. Tim use Win32::FileType;=20 check(".txt"); check(".pl"); check("Perl"); check(".doc"); check("Perl File"); check(".htm"); check(".html"); sub check { print "-"x20,"\n"; ($type)=3D@_; if ($obj =3D Win32::FileType::Open($type))=20 { my ($command,$title); print "type=3D$type\n"; print "title=3D",$obj->Title,"\n"; print "name=3D",$obj->Name,"\n"; print "Icon=3D",$obj->Icon,"\n"; print "Extensions=3D (".join(', ',$obj->Extensions).")\n";=20 ############################################################ #none of this stuff seems to work # # print "Default Action=3D",$obj->DefaultAction,"\n"; print "Action=3D",$obj->Action("Open"),"\n"; ($command,$title) =3D $obj->Action('&open') ; print "command, title=3D$command, $title\n"; ($command,$title) =3D $obj->Action('open') ; print "command, title=3D$command, $title\n"; ($command,$title) =3D $obj->Action("Open") ; print "command, title=3D$command, $title\n"; ($command,$title) =3D $obj->Action($type) ; print "command, title=3D$command, $title\n"; $command =3D $obj->Action($obj->Title) ; print "command, title=3D$command, $title\n"; ($command,$title) =3D $obj->Action($obj->Title) ; print "command, title=3D$command, $title\n"; ($command,$title) =3D $obj->Action($obj->Name) ; print "command, title=3D$command, $title\n"; $command =3D $obj->Action($obj->Name) ; print "command=3D$command\n"; ($command,$title) =3D $obj->Action('') ; print "command, title=3D$command, $title\n"; ($command,$title) =3D $obj->Action("/open/i") ; print "command, title=3D$command, $title\n"; #print "Anything=3D",$obj->Anything(),"\n"; #($action, $title) =3D DDEAction($obj->Name);=20 #print "action, title=3D$action, $title\n"; # # #none of the above stuff seems to work ############################################################ $obj->Close } else {print "\"$type\" is not associated\n";} } ------------------------------------------------------------------------= ------------------------- Tim Thomas Unix Systems Administrator Lockheed Martin EIS =B7 Denver Data Center 303-430-2281 mailto:tim...@lm... ------------------------------------------------------------------------= ------------------------- -----Original Message----- From: Sean Healy [mailto:jal...@ho...] Sent: Thursday, January 11, 2001 9:22 AM To: per...@li... Subject: RE: [perl-win32-gui-users] URL Link Object? Never tried it or even seen anything on it, but theoretically you = should be=20 able to grab the mouse position in the window, and if it falls within = the=20 bounds of the text which should be a link, open an external = application. Some drawbacks: 1) You would have to change the mouse position range every time you = changed=20 the text (or else write a little something to find out the mouse = position=20 range of the text you want - but that would have to take into account = font=20 face, font size, and the length of the preceding string, and might be a = little too complex to bother with. 2) You would have to write something to find the path of the default = browser if you plan to distribute, as not everyone uses the same browser or = keeps it=20 in the same place. However, if you are going to use this only for yourself and not change = the=20 link text (or the text surrounding it), you could theoretically do this = to=20 make it work. >Is there an object within Win32::GUI that will allow you to have a URL = link=20 >in a GUI-window? When you click on the text it should open up your = default=20 >browser and take you to that URL. You know, the kind that a lot of = Apps=20 >have in their About screen. Or is there another way to create this = effect? _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |
From: Jeremy B. <sco...@ya...> - 2001-01-11 17:00:36
|
I found a sample of how to do it in VB. Perhaps it will help. You'll need to download the zip and look in the FHyper.frm file. http://www.mvps.org/vb/code/HyperJmp.zip From the looks of it, he just uses a label and formats the text in the label (underlined, blue) and then fires off the ShellExecute API call to load the URL. I don't have Perl on the machine I'm using so I haven't tried to convert it to Perl syntax yet. Thanks, Jeremy Blonde sco...@ya... --- Sean Healy <jal...@ho...> wrote: > Never tried it or even seen anything on it, but > theoretically you should be > able to grab the mouse position in the window, and > if it falls within the > bounds of the text which should be a link, open an > external application. > > Some drawbacks: > 1) You would have to change the mouse position range > every time you changed > the text (or else write a little something to find > out the mouse position > range of the text you want - but that would have to > take into account font > face, font size, and the length of the preceding > string, and might be a > little too complex to bother with. > > 2) You would have to write something to find the > path of the default browser > if you plan to distribute, as not everyone uses the > same browser or keeps it > in the same place. > > However, if you are going to use this only for > yourself and not change the > link text (or the text surrounding it), you could > theoretically do this to > make it work. > > >Is there an object within Win32::GUI that will > allow you to have a URL link > >in a GUI-window? When you click on the text it > should open up your default > >browser and take you to that URL. You know, the > kind that a lot of Apps > >have in their About screen. Or is there another way > to create this effect? > _________________________________________________________________ > Get your FREE download of MSN Explorer at > http://explorer.msn.com > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users __________________________________________________ Do You Yahoo!? Yahoo! Photos - Share your holiday photos online! http://photos.yahoo.com/ |
From: christopher s. <chr...@ya...> - 2001-01-11 17:16:25
|
can somebody give me 2 or 3 examples of doing something in PERL win32::gui which has already been done in VB ? for example like if it is written like this inVB -----vb code goes here---- then it should be done like this in perl win32 gui ---perl code goes here--- This will help many many programmers who know a bit of VB but a lot of PERL ... simple examples will server as very good pointers I am looking for a VB (or a perl) to be later conversted to win32 GUI code to autostart the default windows dial up connection if a user is NOT connected to the internet ?? and also how to call a windows API call directly from perl ? can anyone give me a raw perl GUI example of calling a win32 API ? chris _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
From: Robert W. <robert@Bangkokwizard.com> - 2001-01-12 15:33:24
Attachments:
GetConnectedState.zip
|
From: "christopher sagayam" <chr...@ya...> > I am looking for a VB (or a perl) to be later conversted to win32 GUI code > to autostart the default windows dial up connection if a user is NOT > connected to the internet ?? see attached..... Very very complete... force dial, go online, RAS, ect. Email me for the exe if you don't run VB. Rob http://bangkokwizard.com/ "Software is like sex: It's better when it's free." -- Linus Torvalds |
From: christopher s. <chr...@ya...> - 2001-01-12 15:50:31
|
Thanks for the code now all I need is to convert it into perl let me take one as example can anyone tell me the equivalent of "Private Declare Function InternetGoOnline Lib "wininet.dll" Alias "InternetGoOnlineA" (ByVal lpszURL As String, ByVal hwndParent As Long, ByVal dwReserved As Long) As Long" in perl ? I mean the vb code is accessing a function present in the wininet.dll I believe ..how to do the same using PERL... chris ----- Original Message ----- From: Robert White <robert@Bangkokwizard.com> To: <per...@li...> Sent: Friday, January 12, 2001 4:24 PM Subject: Re: [perl-win32-gui-users] VB dialup code > From: "christopher sagayam" <chr...@ya...> > > I am looking for a VB (or a perl) to be later conversted to win32 GUI > code > > to autostart the default windows dial up connection if a user is NOT > > connected to the internet ?? > > see attached..... Very very complete... force dial, go online, RAS, ect. > Email me for the exe if you don't run VB. > > Rob > http://bangkokwizard.com/ > "Software is like sex: It's better when it's free." -- Linus Torvalds > > __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com |
From: Reini U. <ru...@sb...> - 2001-01-15 07:10:50
|
christopher sagayam schrieb: > can anyone tell me the equivalent of > "Private Declare Function InternetGoOnline Lib "wininet.dll" Alias > "InternetGoOnlineA" (ByVal lpszURL As String, ByVal hwndParent As Long, > ByVal dwReserved As Long) As Long" > in perl ? > > I mean the vb code is accessing a function present in the wininet.dll I > believe ..how to do the same using PERL... "Declare" is the FFI statement which declares a VB function as external, defined dynamically. The perl counterpart would be using one of the modules Win32::API (also written by Aldo), FFI or C::Dynalib. You normally don't need a FFI as in VB to declare functions. you just have a look into various modules if they aren't defined statically there. E.g. Win32::GUI defines all Win32 GUI methods and callbacks. Win32::RASE e.g. has your required function defined statically. however to answer your question, the perl equivalent is: # VB: "Private Declare Function InternetGoOnline Lib "wininet.dll" Alias # "InternetGoOnlineA" (ByVal lpszURL As String, ByVal hwndParent As Long, # ByVal dwReserved As Long) As Long" use Win32::API; $InternetGoOnline = new Win32::API("wininet", "InternetGoOnlineA", [P,N,N], N); # sample usage: $url = "http://www.myserver.com\0"; # ASCIIZ string! $result = $InternetGoOnline->Call($url,0,0); The FFI and C::Dynalib syntax is similar. FFI is the newest, supports arbitrary callbacks and is generally the best, but has a GPL license only. C::Dynalib and Win32::API have a perl license. -- Reini Urban http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html |
From: christopher s. <chr...@ya...> - 2001-01-15 13:53:12
|
Thanks chris www.perl-resume.com ----- Original Message ----- From: Reini Urban <ru...@sb...> To: <per...@li...> Sent: Monday, January 15, 2001 12:40 PM Subject: Re: [perl-win32-gui-users] VB dialup code > christopher sagayam schrieb: > > can anyone tell me the equivalent of > > "Private Declare Function InternetGoOnline Lib "wininet.dll" Alias > > "InternetGoOnlineA" (ByVal lpszURL As String, ByVal hwndParent As Long, > > ByVal dwReserved As Long) As Long" > > in perl ? > > > > I mean the vb code is accessing a function present in the wininet.dll I > > believe ..how to do the same using PERL... > > "Declare" is the FFI statement which declares a VB function as external, > defined dynamically. > The perl counterpart would be using one of the modules > Win32::API (also written by Aldo), FFI or C::Dynalib. > > You normally don't need a FFI as in VB to declare functions. you just > have a look into various modules if they aren't defined statically there. > E.g. Win32::GUI defines all Win32 GUI methods and callbacks. > Win32::RASE e.g. has your required function defined statically. > > however to answer your question, the perl equivalent is: > > # VB: "Private Declare Function InternetGoOnline Lib "wininet.dll" Alias > # "InternetGoOnlineA" (ByVal lpszURL As String, ByVal hwndParent As Long, > # ByVal dwReserved As Long) As Long" > > use Win32::API; > $InternetGoOnline = new Win32::API("wininet", "InternetGoOnlineA", [P,N,N], > N); > > # sample usage: > $url = "http://www.myserver.com\0"; # ASCIIZ string! > $result = $InternetGoOnline->Call($url,0,0); > > The FFI and C::Dynalib syntax is similar. FFI is the newest, > supports arbitrary callbacks and is generally the best, but has a GPL license > only. > C::Dynalib and Win32::API have a perl license. > -- > Reini Urban > http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |
From: christopher s. <chr...@ya...> - 2001-01-15 01:10:11
|
Thanks chris ----- Original Message ----- From: Mike Blazer <bl...@ma...> To: <per...@li...> Sent: Saturday, January 13, 2001 4:40 AM Subject: Re: [perl-win32-gui-users] something in VB to be converted to perl > Check my Win32::RASE on CPAN - it can do all dialup related suff. > > hth > > christopher sagayam wrote: > > > > can somebody give me 2 or 3 examples of doing something in PERL win32::gui > > which has already been done in VB ? > > -- > ================================== > Mike Blazer > bl...@ma... > ================================== > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |