I was actually 'open' for years, but I've been seeing users not able to launch urls from my apps with that, cause the default browser may not have defined that command, was still using it in the first versions of twitter lib. I added the ShellExecute import to avoid adding another unit; I rather not include entire units for things where I need only a couple procs and such, it adds up to the exe unnecesarily.
As for webbrowser, hmm, I think I still prefer either the PIN or self-auth approach, else, how we know the user actually allowed the app, we can't just blindly assume they'll do and think we are now authorized, so the last PIN step takes care of that. I read somewhere about embedding a chromium window in delphi btw, heard anything? I'm curious to test, gonna check for it. I really still dont like the twebbrowser at all. But maybe I could have a compiler conditional so the user can opt for a way or another. Doesn't GPL allow your code to be included in closed source applications as well? as long as the code hasnt been modified; unless I understood it all wrong. Tbh it's the first time in over ~12 years programming Im opening up to release and share source code, so I never looked much into open source licenses until just now. Would appreciate some insight about it :) On Mon, Feb 28, 2011 at 12:08 AM, RTT <p...@sapo.pt> wrote: > On 27-02-2011 19:29, brian - wrote: > >> I don't really like the idea of embedding the TWebBrowser object, bulky >> and >> buggy activex stuff. >> > > The WebBrowser control works very well for this simple "navigate to a page" > task. > If you want to test, just replace your RequestPIN code with the next one. > > uses > forms, ShDocVw, Controls; > ... > > procedure TwitterCli.RequestPIN; > var > AuthForm: TForm; > WebBrowser: TWebBrowser; > begin > AuthForm := TForm.create(application.MainForm); > with AuthForm do > begin > BorderStyle := bsDialog; > Caption := 'Twitter Authorization - Authorize and close this > dialog'; > width := screen.width - screen.width div 5; > height := screen.height - screen.height div 5; > Position := poScreenCenter; > end; > WebBrowser := TWebBrowser.Create(authForm); > TWinControl(WebBrowser).Parent := authForm; > WebBrowser.Align := alClient; > WebBrowser.Navigate(RequestPinURL); > authForm.ShowModal; > authForm.free; > end; > > > Also, if you in the end decide to maintain the ShellExecute, then better > specify the 'Open' verb. Some system may have the default verb defined > differently. > > ShellExecute(0, 'open', PChar(' > https://twitter.com/oauth/authorize?oauth_token=' + OAuthToken), '', '', > SW_SHOWNORMAL); > > And you don't need to declare the ShellExecute import, just use the one > defined in the ShellAPI unit. > > ----------------------- > Why you decided to use the GPL v3? > IMHO, for small , and simple, code projects like this one, better use a > license that can be used in closed code applications, or commercial users > will just grab/mangle the code and don't give you any credit. > If credit is given, they will need to open the code too, and that isn't > going to happen. On the other hand, if license permits closed code, they > have no problem to include the reference. > > > > > > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be > -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be