whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

35 Visitors Online


 
...Open TCommonDialog in Thumbnail, Report view?
Autor: Thomas Stutz
[ Print tip ]  

Tip Rating (4):  
     


private
    
{ Private declarations }
    
procedure WMUser(var msg: TMessage); message WM_USER+1;
  public
    
{ Public declarations }
  
end;

var
  
Form1: TForm1;

implementation

{$R *.dfm}


const
  
FCIDM_SHVIEW_LARGEICON  = 28713;
  FCIDM_SHVIEW_SMALLICON  = 28714;
  FCIDM_SHVIEW_LIST       = 28715;
  FCIDM_SHVIEW_REPORT     = 28716;
  FCIDM_SHVIEW_THUMBNAIL  = 28717; //    XP only
  
FCIDM_SHVIEW_TILE       = 28718; //    XP

procedure TForm1.WMUser(var msg: TMessage);
var
 
Dlg: HWND;
 Ctrl: HWND;
begin
  
Dlg := msg.WParam;
  Ctrl := FindWindowEx(Dlg, 0, PChar('SHELLDLL_DefView'), nil);
  if Ctrl <> 0 then
  begin
    
SendMessage(Ctrl, WM_COMMAND, FCIDM_SHVIEW_THUMBNAIL, 0 )
  end;
end;

procedure TForm1.OpenDialog1Show(Sender: TObject);
var
  
Dlg: HWND;
begin
  
Dlg := GetParent((Sender as TOpenDialog).Handle);
  PostMessage(Handle, WM_USER+1, Dlg, 0);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  if 
OpenDialog1.Execute then
  begin
  end
;
end;

 

Rate this tip:

poor
very good


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners