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

Reply via email to