Windows Vista, UAC, Defender and Viruses...#

Well, I am back from the SDN Event in Driebergen. It was a fun event, I have met quiet a few people and, after a few years, finally met Dr. Bob again. One of my session was about the Windows 7 Taskbar (an update for the components is in the pipe line, btw). And when talking about Windows 7, one of the question coming up was the user account control (UAC) and how - IF - they have changed it.

While talking about that, I started out to remind them WHY it was implemented in Windows Vista and WHY I have not turned it off, ever. The reason is simple: it was implemented to block viruses from invading your computer and yes, it works. My story for them was as simple as it was obviously surprising for most of them sitting in the room.

About two years ago, I started a small experiment. I set up a computer with a new and clean Windows Vista install. Leaving the UAC on and running updates as Windows reminded me to do just that. The way a user should be working with the PC. However, I have not installed any third party Anti-Virus software, nor any third-party firewall, just the on-board tools Windows Defender and the UAC. I used this PC regularly for internet surfing, writing mails, doing some fun, testing software and so on. I let my girl friend use it for internet surfing - she knows how to use a computer, but by far, she is no geek, or even close to that. She does Excel, Word, mails online, games online, iTunes, etc. Even some peer-to-peer sharing. She had an administrative account and I explained to her what UAC meant and why it was implemented.

Well, end of last year I put on Norton AntiVirus, McAffee and a few other anti-virus tools and ran the big test: All tools reported the same final results: 0 viruses found!

Now my challenge to you: try that with Windows XP in todays Internet world ;-)

Conclusion: yes, the UAC is bothersome at times, and when it pops up to often, it will get the user aggravated, but it has its purpose. With Windows XP's on-board tools you simply where at a large risk when you went online. I am a believer of the UAC and, while it bothers me at times, I support it.

With Windows 7 it shows up less often. So some settings will be changed easier than under Windows Vista without the user confirming that. But as far as I have seen, none of the changes (except setting the computer time of course) will survive the next reboot of your computer. And if you don't mind, under Windows 7 you can move up the UAC messages to the Windows Vista level again. And yes, if you still mind, you can turn it off as well, but I know, I won't.   

Tuesday, March 31, 2009 10:27:56 AM (W. Europe Standard Time, UTC+01:00) #    Comments [5]  | 

 

Google AdSense


Digital Photographie - notes to myself#

If you are interested in (digital) photographie, you might want to check out those sites:

There are more, but those two just stand out. I'll add more over time, I'm sure ;)

English | Fun | Internet | Leben | Pictures
Thursday, May 01, 2008 3:39:37 PM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

TMS Software#

Well, if you remember the old web site of TMS Software, you will be glad to learn, that they have relaunched their web site. It looks so much better, you must go and visit their site, it is well worth your time.

Go visit them now: http://www.tmssoftware.com/

@Bruno: sorry I did not answer your e-mail yet, but I will this weekend. I know I promised an faster response, but time did not permit at the moment.

Friday, March 28, 2008 11:59:10 AM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

DSDT is now Delphi-Treff#

This week the administrators of www.dsdt.info (Delphi-Source, der Delphi-Treff) relaunched the web site with a new design. The new side reminds me of a Web 2.0 portal just from the looks of it. With the relaunch of their site, they chose a new name, simply www.Delphi-Treff.de. It is one of the leading German language Tutorial sites on the web for Delphi developers.

If you know German, check it out.

Tuesday, January 15, 2008 2:55:35 PM (W. Europe Standard Time, UTC+01:00) #    Comments [1]  | 

 

Creating your own interactive Welcome Page#

Often, I am asked how to implement something similar to the CodeGear RAD Studio (aka BDS) Welcome Page. Well, to be honest, I didn't know myself. All I have done for Borland/CodeGear so far, was implementing the whole HTML and JavaScript side, as well as XML and XSL. But this is all open source, and can be found in the $(BDS)\Welcomepage folder. No big secrets here.

Sample application acting on button click in HTML
Sample application acting on button click in HTML

But what you really want to know is, how to give HTML/JavaScript access to your application or how to implement your own URL, such as bds:/default.htm. Well, I took the time and investigated just that, today. And let me tell you, it is easy, once you know where to look. You need to know two interfaces:

  • ICustomDoc - allows you to assign your own document handler for the web browser instance
  • IDocHostUIHandler - allows you to return an interfaced object, that will be accessible from JavaScript and to manipulate the URL requested (as well as many other functions)

First, let me give you the interface declarations, you need:

type
  PDOCHOSTUIINFO = ^TDOCHOSTUIINFO;
  TDOCHOSTUIINFO = record
    cbSize: ULONG;
    dwFlags: DWORD;
    dwDoubleClick: DWORD;
    chHostCss: POleStr;
    chHostNS: POleStr;
  end;

  IDocHostUIHandler = interface(IUnknown)
    ['{bd3f23c0-d43e-11cf-893b-00aa00bdce1a}']
    function ShowContextMenu(const dwID: DWORD; const ppt: PPOINT; const CommandTarget: IUnknown; const Context: IDispatch): HRESULT; stdcall;
    function GetHostInfo(var pInfo: TDOCHOSTUIINFO): HRESULT; stdcall;
    function ShowUI(const dwID: DWORD; const pActiveObject: IOleInPlaceActiveObject; const pCommandTarget: IOleCommandTarget; const pFrame: IOleInPlaceFrame; const pDoc: IOleInPlaceUIWindow): HRESULT; stdcall;
    function HideUI: HRESULT; stdcall;
    function UpdateUI: HRESULT; stdcall;
    function EnableModeless(const fEnable: BOOL): HRESULT; stdcall;
    function OnDocWindowActivate(const fActivate: BOOL): HRESULT; stdcall;
    function OnFrameWindowActivate(const fActivate: BOOL): HRESULT; stdcall;
    function ResizeBorder(const prcBorder: PRECT; const pUIWindow: IOleInPlaceUIWindow; const fRameWindow: BOOL): HRESULT; stdcall;
    function TranslateAccelerator(const lpMsg: PMSG; const pguidCmdGroup: PGUID; const nCmdID: DWORD): HRESULT; stdcall;
    function GetOptionKeyPath(out pchKey: POleStr; const dw: DWORD): HRESULT; stdcall;
    function GetDropTarget(const pDropTarget: IDropTarget; out ppDropTarget: IDropTarget): HRESULT; stdcall;
    function GetExternal(out ppDispatch: IDispatch): HRESULT; stdcall;
    function TranslateUrl(const dwTranslate: DWORD; const pchURLIn: POleStr; out ppchURLOut: POleStr): HRESULT; stdcall;
    function FilterDataObject(const pDO: IDataObject; out ppDORet: IDataObject): HRESULT; stdcall;
  end;

  ICustomDoc = interface(IUnknown)
    ['{3050f3f0-98b5-11cf-bb82-00aa00bdce0b}']
    function SetUIHandler(const pUIHandler: IDocHostUIHandler): HRESULT; stdcall;
  end;

Once you figured those out, the rest is straight forward. Create a new VCL application and place a TWebBrowser component on your form. Before you can assign your own object (in the sample, it is the form itself) you have to load some document. I recommend loading about:blank, that is fast and works always.

procedure TForm8.FormCreate(Sender: TObject);
begin
  // initialize web browser
  wbbDisplay.Navigate('about:blank');
  while wbbDisplay.Busy do
    Application.ProcessMessages;

  // we have to handle some Interface requests, register this form as IDocHostUIHandler
  (wbbDisplay.Document as ICustomDoc).SetUIHandler(Self);
end;

Implement the IDocHostUIHandler interface in your form. Next you need to implement two methods:

  • GetExternal - allows you to return an interfaced object (IDispatch), which you can access from JavaScript
  • TranslateUrl - allows you to manipulate the URL before the web browser will attempt to load the file
  • Return for all other methods either E_NOTIMPL or S_FALSE according to MSDN documentation.
function TForm8.GetExternal(out ppDispatch: IDispatch): HRESULT;
begin
  ppDispatch := TMyApp.Create as IDispatch;
  Result := S_OK;
end;

function TForm8.TranslateUrl(const dwTranslate: DWORD; const pchURLIn: POLESTR; out ppchURLOut: POLESTR): HRESULT;
var
  NewURL: WideString;
begin
  if WideSameText(Copy(pchURLIn, 1, 6), 'app://') then
  begin
    NewURL := ExtractFilePath(Application.ExeName) + Copy(pchURLIn, 7, MaxInt);
    if NewUrl[Length(NewURL)] = '/' then
      SetLength(NewUrl, Length(NewUrl) - 1);
    ppchURLOut := POLESTR(NewURL);
    Result := S_OK;
  end
  else
  begin
    Result := S_FALSE;
  end;
end;

Now, you need to add a type library to your project. Once done, add an automation object (not COM-Object) to your application. This object you will return from the method GetExternal (see above, TMyApp there). Implement your methods as needed and you are done. In the code above, the application will change all URLs starting with app:// to load the files directly from the application folder. For some reason, web browser seems to add an additional slash (/) to the file requested, which has to be removed (see code TranslateUrl).

From JavaScript, you call your applications interfaced object by using the external. statement. If you name your method TestMe, you call it with external.TestMe(); from JavaScript.

That's it already. The sample projected can be downloaded (ZIP, 280 Kb).

Monday, November 12, 2007 6:20:28 PM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

CSS: Have A Real Page Footer#

Often we are challenged in life, especially when it comes to web page design. And when you want to have something "normal" as a page footer, which will always display at the bottom of the page, but never before the end of the content, you are running into THE short coming of the CSS definitions.

It is simply not designed to fit this need. However, one smart guy found a working solution, at least as long as you have a defined height for it.

Well, here you go, use it in your ASP.NET projects :)

Monday, November 12, 2007 11:19:23 AM (W. Europe Standard Time, UTC+01:00) #    Comments [0]  | 

 

All content © 2010, Daniel Wischnewski
On this page
Archives
Promoted Links
Blogroll OPML
My current Flickr Images
www.flickr.com
Dies ist ein Flickr Modul mit �ffentlichen Fotos und Videos von dwischnewski. Ihr eigenes Modul k�nnen Sie hier erstellen.
Recommendations
Sitemap
Special Pages
Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Theme design by Jelle Druyts