7 thoughts on “TCommonDialog. TaskModalDialog bugfix unit

  1. Ricardo Cardona R


    I have error when compile on D2007

    [DCC Error] TaskModalDialogBugFix.pas(85): E2016 Array type required

    Thanks in advance


  2. Andreas Hausladen Post author

    This is now fixed. I became used to Delphi 2009’s pointer arithmetic that works for PByte. But Delphi 2007 doesn’t have this feature.

  3. Andreas Hausladen Post author

    In Delphi 2009 you can use any pointer and add, substract (, multiply, divide) them. In Delphi 2007 you can do this only with PWideChar, PAnsiChar (PChar). The new feature makes these ugly and dangerous (for 3GB address space) PByte(Integer(ptr) + 10) obsolete.

    P, F: PByte;
    B: Byte;
    Distance: Integer;
    F := P;
    P := P + 10; <- new Distance := P - F; <- new B := P[10]; <- new end;

  4. A Random Kiwi

    Is this IDE fix also available for our applications

    “Sometimes the IDE has two taskbar buttons”

    I frequently see it after the application has been busy (and showed a progress dialog)

  5. Andreas Hausladen Post author

    Delphi 2009 fixes this. But for Delphi 2007 I haven’t released a fix unit for the two liner that you can use after your main form is visible:

    ShowWindow(Application.Handle, SW_HIDE);
    SetWindowLong(Application.Handle, GWL_EXSTYLE,
    (GetWindowLong(Application.Handle, GWL_EXSTYLE) and not WS_EX_APPWINDOW) or WS_EX_TOOLWINDOW);

  6. A Random Kiwi

    Thanks Andreas,

    I’ve added to the Main Form OnFormShow. As I cannot reproduce the issue consistently I am unable to validate the fix, so is there anywhere I can read about why the solution should work.


Comments are closed.