Changeset 130


Ignore:
Timestamp:
May 23, 2005, 9:04:06 PM (20 years ago)
Author:
root
Message:

Use QWL_USER

Location:
trunk/dll
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r123 r130  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2004 Steven H.Levine
    10 
    11   Revisions     11 Jun 02 SHL - Ensure archive name not garbage
    12                 22 May 03 SHL - ArcObjWndProc: fix UM_RESCAN now that we understand it
    13                 01 Aug 04 SHL - Rework lstrip/rstrip usage
     9  Copyright (c) 2001, 2005 Steven H.Levine
     10
     11  11 Jun 02 SHL Ensure archive name not garbage
     12  22 May 03 SHL ArcObjWndProc: fix UM_RESCAN now that we understand it
     13  01 Aug 04 SHL Rework lstrip/rstrip usage
     14  23 May 05 SHL Use QWL_USER
    1415
    1516***********************************************************************/
     
    5455      else {
    5556        ad = (ARCDUMP *)mp2;
    56         WinSetWindowPtr(hwnd,0,ad);
     57        WinSetWindowPtr(hwnd,QWL_USER,ad);
    5758        if(ad->errmsg)
    5859          WinSetDlgItemText(hwnd,
     
    8788
    8889        case DID_OK:
    89           ad = WinQueryWindowPtr(hwnd,0);
     90          ad = WinQueryWindowPtr(hwnd,QWL_USER);
    9091          WinDlgBox(HWND_DESKTOP,hwnd,ArcReviewDlgProc,FM3ModHandle,
    9192                    AD_FRAME,MPFROMP(ad));
     
    9495
    9596        case ARCERR_VIEW:
    96           ad = WinQueryWindowPtr(hwnd,0);
     97          ad = WinQueryWindowPtr(hwnd,QWL_USER);
    9798          {
    9899            CHAR *list[2];
     
    118119
    119120        case ARCERR_TEST:
    120           ad = WinQueryWindowPtr(hwnd,0);
     121          ad = WinQueryWindowPtr(hwnd,QWL_USER);
    121122          runemf2(SEPARATEKEEP | WINDOWED | MAXIMIZED,
    122123                  hwnd,NULL,NULL,"%s %s%s%s",ad->info->test,
     
    812813        if(fOtherHelp) {
    813814          if((!hwndBubble ||
    814               WinQueryWindowULong(hwndBubble,0) != hwnd) &&
     815              WinQueryWindowULong(hwndBubble,QWL_USER) != hwnd) &&
    815816             !WinQueryCapture(HWND_DESKTOP)) {
    816817            switch(id) {
     
    11721173
    11731174    case DM_RENDER:
    1174       dcd = WinQueryWindowPtr(hwnd,0);
     1175      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    11751176      if(dcd && dcd->info && dcd->info->extract && dcd->arcname) {
    11761177
     
    12171218        USHORT         usRes = DMFL_RENDERFAIL;
    12181219
    1219         dcd = WinQueryWindowPtr(hwnd,0);
     1220        dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    12201221        if(dcd && dcd->info && dcd->info->extract && dcd->arcname) {
    12211222
     
    12691270
    12701271    case UM_SETUP:
    1271       dcd = WinQueryWindowPtr(hwnd,0);
     1272      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    12721273      if(dcd) {
    12731274        /* set unique id */
     
    12851286       * populate container
    12861287       */
    1287       dcd = WinQueryWindowPtr(hwnd,0);
     1288      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    12881289      if(dcd) {
    12891290        if(mp1)
     
    13271328
    13281329    case UM_SELECT:
    1329       dcd = WinQueryWindowPtr(hwnd,0);
     1330      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    13301331      if(dcd) {
    13311332        switch(SHORT1FROMMP(mp1)) {
     
    13701371
    13711372    case UM_ENTER:
    1372       dcd = WinQueryWindowPtr(hwnd,0);
     1373      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    13731374      if(dcd) {
    13741375
     
    14271428    case UM_ACTION:
    14281429      DosError(FERR_DISABLEHARDERR);
    1429       dcd = WinQueryWindowPtr(hwnd,0);
     1430      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    14301431      if(dcd) {
    14311432
     
    19631964
    19641965    case WM_DESTROY:
    1965       dcd = WinQueryWindowPtr(hwnd,0);
     1966      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    19661967      if(dcd) {
    19671968        if(*dcd->workdir) {
     
    19771978        WinSendMsg(dcd->hwndCnr,UM_CLOSE,MPVOID,MPVOID);
    19781979        free(dcd);
    1979         WinSetWindowPtr(dcd->hwndCnr,0,NULL);
     1980        WinSetWindowPtr(dcd->hwndCnr,QWL_USER,NULL);
    19801981      }
    19811982      if(!PostMsg((HWND)0,WM_QUIT,MPVOID,MPVOID))
     
    19891990MRESULT EXPENTRY ArcCnrWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
    19901991
    1991   DIRCNRDATA *dcd = WinQueryWindowPtr(hwnd,0);
     1992  DIRCNRDATA *dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    19921993
    19931994  switch(msg) {
     
    34793480                     MPVOID);
    34803481      }
    3481       dcd = WinQueryWindowPtr(hwnd,0);
     3482      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    34823483      if(!dcd ||
    34833484         (!dcd->dontclose &&
  • trunk/dll/autoview.c

    r51 r130  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2002 Steven H.Levine
    10 
    11   Revisions     12 Sep 02 SHL - AutoObjProc: catch buff2 overflows
    12                 25 Oct 02 SHL - CreateHexDump: catch buffer overflow
    13                 12 Feb 03 SHL - AutoObjProc: standardize EA math
     9  Copyright (c) 2001, 2005 Steven H.Levine
     10
     11  12 Sep 02 SHL AutoObjProc: catch buff2 overflows
     12  25 Oct 02 SHL CreateHexDump: catch buffer overflow
     13  12 Feb 03 SHL AutoObjProc: standardize EA math
     14  23 May 05 SHL Use QWL_USER
    1415
    1516***********************************************************************/
     
    650651                                    NULL);
    651652      if(hwndAutoObj) {
    652         WinSetWindowULong(hwndAutoObj,0,hwndParent);
     653        WinSetWindowULong(hwndAutoObj,QWL_USER,hwndParent);
    653654        priority_normal();
    654655        while(WinGetMsg(hab2,&qmsg2,(HWND)0,0,0))
  • trunk/dll/collect.c

    r123 r130  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2003, 2004 Steven H.Levine
    10 
    11   Revisions     15 Oct 02 MK Baseline
    12                 10 Jan 04 SHL Avoid -1L byte counts
    13                 01 Aug 04 SHL Rework lstrip/rstrip usage
     9  Copyright (c) 2003, 2005 Steven H.Levine
     10
     11  15 Oct 02 MK Baseline
     12  10 Jan 04 SHL Avoid -1L byte counts
     13  01 Aug 04 SHL Rework lstrip/rstrip usage
     14  23 May 05 SHL Use QWL_USER
    1415
    1516***********************************************************************/
     
    226227        if(fOtherHelp) {
    227228          if((!hwndBubble ||
    228               WinQueryWindowULong(hwndBubble,0) != hwnd) &&
     229              WinQueryWindowULong(hwndBubble,QWL_USER) != hwnd) &&
    229230             !WinQueryCapture(HWND_DESKTOP)) {
    230231            switch(id) {
     
    507508
    508509    case UM_UPDATERECORDLIST:
    509       dcd = WinQueryWindowPtr(hwnd,0);
     510      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    510511      if(dcd && mp1) {
    511512
     
    521522
    522523    case UM_SETUP:
    523       dcd = WinQueryWindowPtr(hwnd,0);
     524      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    524525      if(dcd) {
    525526        /* set unique id */
     
    575576    case UM_COLLECT:
    576577      DosError(FERR_DISABLEHARDERR);
    577       dcd = WinQueryWindowPtr(hwnd,0);
     578      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    578579      if (dcd)
    579580      {
     
    682683
    683684    case UM_COLLECTFROMFILE:
    684       dcd = WinQueryWindowPtr(hwnd,0);
     685      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    685686      if(dcd && mp1) {
    686687
     
    770771
    771772    case UM_SELECT:
    772       dcd = WinQueryWindowPtr(hwnd,0);
     773      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    773774      if(dcd) {
    774775        switch(SHORT1FROMMP(mp1)) {
     
    871872      if(mp1) {
    872873
    873         dcd = WinQueryWindowPtr(hwnd,0);
     874        dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    874875        if(dcd) {
    875876
     
    900901      if(mp1) {
    901902
    902         dcd = WinQueryWindowPtr(hwnd,0);
     903        dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    903904        if(dcd) {
    904905
     
    931932
    932933    case WM_DESTROY:
    933       dcd = WinQueryWindowPtr(hwnd,0);
     934      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    934935      if(dcd) {
    935936
     
    954955MRESULT EXPENTRY CollectorCnrWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
    955956
    956   DIRCNRDATA *dcd = WinQueryWindowPtr(hwnd,0);
     957  DIRCNRDATA *dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    957958  INT         tempsortFlags;
    958959
     
    28552856      if(dcd->hwndCnr) {
    28562857        Collector = dcd->hwndCnr;
    2857         WinSetWindowPtr(dcd->hwndCnr,0,(PVOID)dcd);
     2858        WinSetWindowPtr(dcd->hwndCnr,QWL_USER,(PVOID)dcd);
    28582859        WinSetWindowText(hwndFrame,
    28592860                         GetPString(IDS_COLLECTORTITLETEXT));
  • trunk/dll/datamin.c

    r36 r130  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2002 Steven H.Levine
    10 
    11   Revisions     14 Sep 02 SHL - Handle large partitions
    12                 16 Oct 02 SHL - Handle large partitions better
     9  Copyright (c) 2001, 2005 Steven H.Levine
     10
     11  14 Sep 02 SHL Handle large partitions
     12  16 Oct 02 SHL Handle large partitions better
     13  23 May 05 SHL Use QWL_USER
    1314
    1415***********************************************************************/
     
    253254
    254255    case UM_RESTORE:
    255       WinSetWindowPtr(hwnd,0,mp1);
     256      WinSetWindowPtr(hwnd,QWL_USER,mp1);
    256257      return 0;
    257258
     
    11091110        ULONG fl = SWP_SHOW | SWP_ZORDER | SWP_ACTIVATE,ofl;
    11101111
    1111         ofl = WinQueryWindowULong(hwnd,0);
     1112        ofl = WinQueryWindowULong(hwnd,QWL_USER);
    11121113        WinQueryWindowPos(WinQueryWindow(hwndMain,QW_PARENT),&swp);
    11131114        if(swp.fl & SWP_MINIMIZE)
  • trunk/dll/dircnrs.c

    r123 r130  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2004 Steven H.Levine
    10 
    11   Revisions     16 Oct 02 SHL Handle large partitions
    12                 01 Aug 04 SHL Rework lstrip/rstrip usage
     9  Copyright (c) 2001, 2005 Steven H.Levine
     10
     11  16 Oct 02 SHL Handle large partitions
     12  01 Aug 04 SHL Rework lstrip/rstrip usage
     13  23 May 05 SHL Use QWL_USER
    1314
    1415***********************************************************************/
     
    299300        if(fOtherHelp) {
    300301          if((!hwndBubble ||
    301               WinQueryWindowULong(hwndBubble,0) != hwnd) &&
     302              WinQueryWindowULong(hwndBubble,QWL_USER) != hwnd) &&
    302303             !WinQueryCapture(HWND_DESKTOP)) {
    303304            switch(id) {
     
    492493
    493494        *(CHAR *)mp1 = 0;
    494         dcd = WinQueryWindowPtr(WinWindowFromID(hwnd,DIR_CNR),0);
     495        dcd = WinQueryWindowPtr(WinWindowFromID(hwnd,DIR_CNR),QWL_USER);
    495496        if(dcd)
    496497          strcpy((CHAR *)mp1,dcd->directory);
     
    660661
    661662    case UM_UPDATERECORDLIST:
    662       dcd = WinQueryWindowPtr(hwnd,0);
     663      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    663664      if(dcd && mp1) {
    664665
     
    678679
    679680    case UM_SETUP:
    680       dcd = WinQueryWindowPtr(hwnd,0);
     681      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    681682      if(dcd) {
    682683        /* set unique id */
     
    693694
    694695    case UM_RESCAN2:
    695       dcd = WinQueryWindowPtr(hwnd,0);
     696      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    696697      if(dcd && dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent)) {
    697698
     
    734735
    735736    case UM_FLESH:
    736       dcd = WinQueryWindowPtr(hwnd,0);
     737      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    737738      if(dcd) {
    738739
     
    767768       * populate container
    768769       */
    769       dcd = WinQueryWindowPtr(hwnd,0);
     770      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    770771      if(dcd) {
    771772        DosEnterCritSec();
     
    952953
    953954    case UM_SELECT:
    954       dcd = WinQueryWindowPtr(hwnd,0);
     955      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    955956      if(dcd) {
    956957        switch(SHORT1FROMMP(mp1)) {
     
    10791080      if(mp1) {
    10801081
    1081         dcd = WinQueryWindowPtr(hwnd,0);
     1082        dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    10821083        if(dcd) {
    10831084
     
    11081109      if(mp1) {
    11091110
    1110         dcd = WinQueryWindowPtr(hwnd,0);
     1111        dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    11111112        if(dcd) {
    11121113
     
    11391140
    11401141    case WM_DESTROY:
    1141       dcd = WinQueryWindowPtr(hwnd,0);
     1142      dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    11421143      if(dcd) {
    11431144        if(dcd->hwndRestore)
     
    11701171
    11711172  ULONG ulrc;
    1172   DIRCNRDATA *dcd = WinQueryWindowPtr(hwnd,0);
     1173  DIRCNRDATA *dcd = WinQueryWindowPtr(hwnd,QWL_USER);
    11731174
    11741175  switch(msg) {
     
    39053906                                       NULL);
    39063907        if(dcd->hwndCnr) {
    3907           WinSetWindowPtr(dcd->hwndCnr,0,(PVOID)dcd);
     3908          WinSetWindowPtr(dcd->hwndCnr,QWL_USER,(PVOID)dcd);
    39083909          dcd->oldproc = WinSubclassWindow(dcd->hwndCnr,
    39093910                                           (PFNWP)DirCnrWndProc);
  • trunk/dll/grep2.c

    r123 r130  
    55
    66  Copyright (c) 1993-98 M. Kimes
    7   Copyright (c) 2004 Steven H.Levine
    8 
    9   Revisions     01 Aug 04 SHL - Rework lstrip/rstrip usage
     7  Copyright (c) 2004, 2005 Steven H.Levine
     8
     9  01 Aug 04 SHL Rework lstrip/rstrip usage
     10  23 May 05 SHL Use QWL_USER
    1011
    1112***********************************************************************/
     
    4243    case WM_INITDLG:
    4344      if(mp2) {
    44         WinSetWindowPtr(hwnd,0,mp2);
     45        WinSetWindowPtr(hwnd,QWL_USER,mp2);
    4546        *(CHAR *)mp2 = 0;
    4647        {
     
    130131        case DID_OK:
    131132          {
    132             CHAR *p = WinQueryWindowPtr(hwnd,0);
     133            CHAR *p = WinQueryWindowPtr(hwnd,QWL_USER);
    133134
    134135            if(p) {
     
    180181        break;
    181182      }
    182       WinSetWindowULong(hwnd,0,*(HWND *)mp2);
     183      WinSetWindowULong(hwnd,QWL_USER,*(HWND *)mp2);
    183184      WinSendDlgItemMsg(hwnd,
    184185                        GREP_MASK,
     
    889890
    890891        case DID_OK:
    891           hwndCollect = WinQueryWindowULong(hwnd,0);
     892          hwndCollect = WinQueryWindowULong(hwnd,QWL_USER);
    892893          if(!hwndCollect)
    893894            DosBeep(50,100);
  • trunk/dll/info.c

    r123 r130  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2004 Steven H.Levine
    10 
    11   Revisions     16 Oct 02 SHL - Handle large partitions
    12                 12 Feb 03 SHL - FileInfoProc: standardize EA math
    13                 01 Aug 04 SHL - Rework lstrip/rstrip usage
     9  Copyright (c) 2001, 2005 Steven H.Levine
     10
     11  16 Oct 02 SHL - Handle large partitions
     12  12 Feb 03 SHL - FileInfoProc: standardize EA math
     13  01 Aug 04 SHL - Rework lstrip/rstrip usage
     14  23 May 05 SHL Use QWL_USER
    1415
    1516***********************************************************************/
     
    8687
    8788        filename = (CHAR *)mp2;
    88         WinSetWindowPtr(hwnd,0,(PVOID)filename);
     89        WinSetWindowPtr(hwnd,QWL_USER,(PVOID)filename);
    8990        WinSendDlgItemMsg(hwnd,
    9091                          INFO_LABEL,
     
    367368  static BOOL emphasized = FALSE;
    368369
    369   is = (ICONSTUF *)WinQueryWindowPtr(hwnd,0);
     370  is = (ICONSTUF *)WinQueryWindowPtr(hwnd,QWL_USER);
    370371
    371372  switch(msg) {
     
    538539      is->list = (CHAR **)mp2;
    539540      is->size = sizeof(ICONSTUF);
    540       WinSetWindowPtr(hwnd,0,is);
     541      WinSetWindowPtr(hwnd,QWL_USER,is);
    541542      {
    542543        USHORT ids[] = {FLE_SIZES,FLE_SLACK,FLE_LASTWRITE,FLE_CREATE,
     
    588589          switch(SHORT2FROMMP(mp1)) {
    589590            case BN_CLICKED:
    590               is = WinQueryWindowPtr(hwnd,0);
     591              is = WinQueryWindowPtr(hwnd,QWL_USER);
    591592              if(is && *is->filename) {
    592593
     
    623624            case LN_ENTER:
    624625            case LN_SELECT:
    625               is = WinQueryWindowPtr(hwnd,0);
     626              is = WinQueryWindowPtr(hwnd,QWL_USER);
    626627              if(is) {
    627628
     
    690691      WinCheckButton(hwnd,FLE_VIRTDRV,FALSE);
    691692      WinCheckButton(hwnd,FLE_PROTDLL,FALSE);
    692       is = WinQueryWindowPtr(hwnd,0);
     693      is = WinQueryWindowPtr(hwnd,QWL_USER);
    693694      if(is && *is->filename) {
    694695
     
    942943      switch(SHORT1FROMMP(mp1)) {
    943944        case DID_OK:
    944           is = WinQueryWindowPtr(hwnd,0);
     945          is = WinQueryWindowPtr(hwnd,QWL_USER);
    945946          WinDismissDlg(hwnd,(is && is->madechanges) ? 2 : 1);
    946947          break;
     
    953954          break;
    954955        case FLE_SETTINGS:
    955           is = WinQueryWindowPtr(hwnd,0);
     956          is = WinQueryWindowPtr(hwnd,QWL_USER);
    956957          if(is && *is->filename)
    957958            OpenObject(is->filename,
     
    960961          break;
    961962        case FLE_EAS:
    962           is = WinQueryWindowPtr(hwnd,0);
     963          is = WinQueryWindowPtr(hwnd,QWL_USER);
    963964          if(is && *is->filename) {
    964965
     
    976977          break;
    977978        case DID_CANCEL:
    978           is = WinQueryWindowPtr(hwnd,0);
     979          is = WinQueryWindowPtr(hwnd,QWL_USER);
    979980          WinDismissDlg(hwnd,(is && is->madechanges) ? 2 : 0);
    980981          break;
     
    983984
    984985    case WM_DESTROY:
    985       is = WinQueryWindowPtr(hwnd,0);
     986      is = WinQueryWindowPtr(hwnd,QWL_USER);
    986987      if(is)
    987988        free(is);
     
    10291030    case UM_UNDO:
    10301031      {
    1031         ULONG drive = WinQueryWindowULong(hwnd,0);
     1032        ULONG drive = WinQueryWindowULong(hwnd,QWL_USER);
    10321033
    10331034        WinCheckButton(hwnd,DVS_REMOVABLE,
     
    10711072        case DID_OK:
    10721073          {
    1073             ULONG drive = WinQueryWindowULong(hwnd,0);
     1074            ULONG drive = WinQueryWindowULong(hwnd,QWL_USER);
    10741075
    10751076            if(WinQueryButtonCheckstate(hwnd,DVS_NOPRESCAN))
  • trunk/dll/mainwnd.c

    r123 r130  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2004 Steven H.Levine
    10 
    11   Revisions     11 Jun 02 SHL - Drop obsolete xor code
    12                 16 Oct 02 SHL - Handle large partitions
    13                 01 Aug 04 SHL - Rework lstrip/rstrip usage
     9  Copyright (c) 2001, 2005 Steven H.Levine
     10
     11  11 Jun 02 SHL Drop obsolete xor code
     12  16 Oct 02 SHL Handle large partitions
     13  01 Aug 04 SHL Rework lstrip/rstrip usage
     14  23 May 05 SHL Use QWL_USER
    1415
    1516***********************************************************************/
     
    9394                                    DRIVE_SLOW)) &&
    9495           (!hwndBubble ||
    95               WinQueryWindowULong(hwndBubble,0) != hwndB) &&
     96              WinQueryWindowULong(hwndBubble,QWL_USER) != hwndB) &&
    9697             !WinQueryCapture(HWND_DESKTOP)) {
    9798
     
    129130          }
    130131          if((!hwndBubble ||
    131               WinQueryWindowULong(hwndBubble,0) != hwndB) &&
     132              WinQueryWindowULong(hwndBubble,QWL_USER) != hwndB) &&
    132133             !WinQueryCapture(HWND_DESKTOP))
    133134          WinSendMsg(hwndB,
     
    240241                                       NULL);
    241242                        if(MainObjectHwnd) {
    242                                 WinSetWindowPtr(MainObjectHwnd,0,args);
     243                                WinSetWindowPtr(MainObjectHwnd,QWL_USER,args);
    243244                                while(WinGetMsg(hab2,&qmsg2,(HWND)0,0,0))
    244245                                        WinDispatchMsg(hab2,&qmsg2);
     
    770771      (!other && !drive && fToolbarHelp))) {
    771772    if((!hwndBubble ||
    772         WinQueryWindowULong(hwndBubble,0) != hwnd) &&
     773        WinQueryWindowULong(hwndBubble,QWL_USER) != hwnd) &&
    773774       !WinQueryCapture(HWND_DESKTOP))
    774775      MakeBubble(hwnd,
     
    830831                lyScreen = WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN);
    831832                lxScreen = WinQuerySysValue(HWND_DESKTOP,SV_CXSCREEN);
    832                 WinSetWindowULong(hwndBubble,0,hwnd);
     833                WinSetWindowULong(hwndBubble,QWL_USER,hwnd);
    833834    SetPresParams(hwndBubble,
    834835                  NULL,
     
    919920                                WinQueryPointerPos(HWND_DESKTOP,&ptl);
    920921                                if(WinWindowFromPoint(HWND_DESKTOP,&ptl,TRUE) !=
    921                                          WinQueryWindowULong(hwnd,0) ||
     922                                         WinQueryWindowULong(hwnd,QWL_USER) ||
    922923                                         !WinIsWindowVisible(hwnd))
    923924          WinDestroyWindow(hwnd);
     
    11671168                case WM_MOUSEMOVE:
    11681169                        if(fToolbarHelp) {
    1169                                 if((!hwndBubble || WinQueryWindowULong(hwndBubble,0) != hwnd) &&
     1170                                if((!hwndBubble || WinQueryWindowULong(hwndBubble,QWL_USER) != hwnd) &&
    11701171                                         !WinQueryCapture(HWND_DESKTOP)) {
    11711172                                        id = WinQueryWindowUShort(hwnd,QWS_ID);
     
    15671568MRESULT EXPENTRY CommandLineProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
    15681569
    1569         PFNWP           oldproc = (PFNWP)WinQueryWindowPtr(hwnd,0);
     1570        PFNWP           oldproc = (PFNWP)WinQueryWindowPtr(hwnd,QWL_USER);
    15701571        static BOOL     lbup = FALSE;
    15711572
     
    18351836      if(fDrivebarHelp &&
    18361837         (!hwndBubble ||
    1837           WinQueryWindowULong(hwndBubble,0) != hwnd) &&
     1838          WinQueryWindowULong(hwndBubble,QWL_USER) != hwnd) &&
    18381839         !WinQueryCapture(HWND_DESKTOP)) {
    18391840        id = WinQueryWindowUShort(hwnd,QWS_ID);
     
    18541855        if((char *)mp1 &&
    18551856           (!hwndBubble ||
    1856             WinQueryWindowULong(hwndBubble,0) != hwnd) &&
     1857            WinQueryWindowULong(hwndBubble,QWL_USER) != hwnd) &&
    18571858           !WinQueryCapture(HWND_DESKTOP)) {
    18581859
     
    24432444
    24442445                                if(fOtherHelp) {
    2445                                         if((!hwndBubble || WinQueryWindowULong(hwndBubble,0) != hwnd) &&
     2446                                        if((!hwndBubble || WinQueryWindowULong(hwndBubble,QWL_USER) != hwnd) &&
    24462447                                                 !WinQueryCapture(HWND_DESKTOP)) {
    24472448                                                switch(id) {
     
    30373038                                (PVOID)&swp,
    30383039                                sizeof(SWP));
    3039                                                 dcd = WinQueryWindowPtr(WinWindowFromID(hwndC,DIR_CNR),0);
     3040                                                dcd = WinQueryWindowPtr(WinWindowFromID(hwndC,DIR_CNR),QWL_USER);
    30403041                                                if(dcd) {
    30413042              sprintf(s,"%s%sDirCnrSort.%lu",(name) ? name : NullStr,(name) ? "." : NullStr,
     
    38473848                case WM_MOUSEMOVE:
    38483849                        if(fOtherHelp) {
    3849                                 if((!hwndBubble || WinQueryWindowULong(hwndBubble,0) != hwnd) &&
     3850                                if((!hwndBubble || WinQueryWindowULong(hwndBubble,QWL_USER) != hwnd) &&
    38503851                                         !WinQueryCapture(HWND_DESKTOP)) {
    38513852                                        id = WinQueryWindowUShort(hwnd,QWS_ID);
     
    39963997MRESULT EXPENTRY MainFrameWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
    39973998
    3998   PFNWP        oldproc = (PFNWP)WinQueryWindowPtr(hwnd,0);
     3999  PFNWP        oldproc = (PFNWP)WinQueryWindowPtr(hwnd,QWL_USER);
    39994000        static ULONG aheight = 0L;
    40004001
     
    45684569
    45694570
    4570 MRESULT EXPENTRY MainWMCommand (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
    4571 
     4571MRESULT EXPENTRY MainWMCommand (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
     4572{
    45724573  SetShiftState();
    45734574  switch(SHORT1FROMMP(mp1)) {
     
    51005101
    51015102    case IDM_AUTOVIEW:
    5102       SetMenuCheck(WinQueryWindowULong(hwnd,0),SHORT1FROMMP(mp1),
     5103      SetMenuCheck(WinQueryWindowULong(hwnd,QWL_USER),SHORT1FROMMP(mp1),
    51035104                   &fAutoView,TRUE,"AutoView");
    51045105AutoChange:
     
    51355136
    51365137    case IDM_TEXTTOOLS:
    5137       SetMenuCheck(WinQueryWindowULong(hwnd,0),SHORT1FROMMP(mp1),
     5138      SetMenuCheck(WinQueryWindowULong(hwnd,QWL_USER),SHORT1FROMMP(mp1),
    51385139                   &fTextTools,TRUE,"TextTools");
    51395140      BuildTools(hwndToolback,TRUE);
     
    51435144
    51445145    case IDM_TOOLTITLES:
    5145       SetMenuCheck(WinQueryWindowULong(hwnd,0),SHORT1FROMMP(mp1),
     5146      SetMenuCheck(WinQueryWindowULong(hwnd,QWL_USER),SHORT1FROMMP(mp1),
    51465147                   &fToolTitles,TRUE,"ToolTitles");
    51475148      BuildTools(hwndToolback,TRUE);
     
    51545155        HWND   hwndMenu;
    51555156
    5156         hwndMenu = WinQueryWindowULong(hwnd,0);
     5157        hwndMenu = WinQueryWindowULong(hwnd,QWL_USER);
    51575158        MenuInvisible = (MenuInvisible) ? FALSE : TRUE;
    51585159        if(MenuInvisible) {
     
    52395240
    52405241    case IDM_TOOLBAR:
    5241       SetMenuCheck(WinQueryWindowULong(hwnd,0),
     5242      SetMenuCheck(WinQueryWindowULong(hwnd,QWL_USER),
    52425243                   IDM_TOOLSUBMENU,
    52435244                   &fToolbar,
     
    52615262
    52625263    case IDM_DRIVEBAR:
    5263       SetMenuCheck(WinQueryWindowULong(hwnd,0),
     5264      SetMenuCheck(WinQueryWindowULong(hwnd,QWL_USER),
    52645265                   IDM_DRIVEBAR,
    52655266                   &fDrivebar,
     
    52805281
    52815282    case IDM_USERLIST:
    5282       SetMenuCheck(WinQueryWindowULong(hwnd,0),
     5283      SetMenuCheck(WinQueryWindowULong(hwnd,QWL_USER),
    52835284                   SHORT1FROMMP(mp1),
    52845285                   &fUserComboBox,
     
    53125313      WinSetWindowText(hwndDate,NullStr);
    53135314      WinSetWindowText(hwndAttr,NullStr);
    5314       SetMenuCheck(WinQueryWindowULong(hwnd,0),
     5315      SetMenuCheck(WinQueryWindowULong(hwnd,QWL_USER),
    53155316                   SHORT1FROMMP(mp1),
    53165317                   &fMoreButtons,
     
    53455346        WinSetWindowPos(hwndTree,HWND_TOP,0,swp.cy - swpT.cy,0,0,SWP_MOVE);
    53465347      }
    5347       SetMenuCheck(WinQueryWindowULong(hwnd,0),SHORT1FROMMP(mp1),
     5348      SetMenuCheck(WinQueryWindowULong(hwnd,QWL_USER),SHORT1FROMMP(mp1),
    53485349                   &fFreeTree,TRUE,"FreeTree");
    53495350      if(fAutoTile)
     
    53525353
    53535354    case IDM_AUTOTILE:
    5354       SetMenuCheck(WinQueryWindowULong(hwnd,0),
     5355      SetMenuCheck(WinQueryWindowULong(hwnd,QWL_USER),
    53555356                   SHORT1FROMMP(mp1),
    53565357                   &fAutoTile,
     
    53625363
    53635364    case IDM_TILEBACKWARDS:
    5364       SetMenuCheck(WinQueryWindowULong(hwnd,0),
     5365      SetMenuCheck(WinQueryWindowULong(hwnd,QWL_USER),
    53655366                   SHORT1FROMMP(mp1),
    53665367                   &fTileBackwards,
     
    54165417
    54175418    default:
    5418       if(!SwitchCommand((HWND)WinQueryWindowULong(hwnd,0),
     5419      if(!SwitchCommand((HWND)WinQueryWindowULong(hwnd,QWL_USER),
    54195420                        SHORT1FROMMP(mp1))) {
    54205421        if(SHORT1FROMMP(mp1) >= IDM_COMMANDSTART &&
     
    57815782                                    (PFNWP)DropDownListProc);
    57825783        if(oldproc)
    5783           WinSetWindowPtr(hwndDrivelist,0,(PVOID)oldproc);
     5784          WinSetWindowPtr(hwndDrivelist,QWL_USER,(PVOID)oldproc);
    57845785        oldproc = WinSubclassWindow(hwndButtonlist,
    57855786                                    (PFNWP)DropDownListProc);
     
    62196220                        switch(SHORT1FROMMP(mp1)) {
    62206221                                case IDM_CONFIGMENU:
    6221                                         SetToggleChecks((HWND)WinQueryWindowULong(hwnd,0));
     6222                                        SetToggleChecks((HWND)WinQueryWindowULong(hwnd,QWL_USER));
    62226223                                        break;
    62236224
     
    62316232                                                MENUITEM mi;
    62326233
    6233                                                 hwndMenu = WinQueryWindowULong(hwnd,0);
     6234                                                hwndMenu = WinQueryWindowULong(hwnd,QWL_USER);
    62346235                                                memset(&mi,0,sizeof(mi));
    62356236                                                mi.iPosition = MIT_END;
  • trunk/dll/newview.c

    r83 r130  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2003 Steven H.Levine
    10 
    11   Revisions     01 Dec 03 SHL - Comments
    12                 02 Dec 03 SHL - Correct WM_VSCROLL math
     9  Copyright (c) 2001, 2005 Steven H.Levine
     10
     11  01 Dec 03 SHL Comments
     12  02 Dec 03 SHL Correct WM_VSCROLL math
     13  23 May 05 SHL Use QWL_USER
    1314
    1415***********************************************************************/
     
    124125        SHORT count;
    125126
    126         WinSetWindowPtr(hwnd,0,mp2);
     127        WinSetWindowPtr(hwnd,QWL_USER,mp2);
    127128        urld = mp2;
    128129        e = urld->line + urld->len + 1;
     
    203204            SHORT select;
    204205
    205             urld = WinQueryWindowPtr(hwnd,0);
     206            urld = WinQueryWindowPtr(hwnd,QWL_USER);
    206207            if(urld) {
    207208              select = (SHORT)WinSendDlgItemMsg(hwnd,URL_LISTBOX,
     
    261262static CHAR **BuildAList (HWND hwnd)
    262263{
    263   VIEWDATA      *ad = WinQueryWindowPtr(hwnd,0);
     264  VIEWDATA      *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    264265  register ULONG x,y,z = 0;
    265266  ULONG          width;
     
    342343static CHAR **BuildAList2 (HWND hwnd)
    343344{
    344   VIEWDATA      *ad = WinQueryWindowPtr(hwnd,0);
     345  VIEWDATA      *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    345346  CHAR         **list = NULL,s[SEARCHSTRINGLEN];
    346347  SHORT          x,z;
     
    377378
    378379        if(fOtherHelp) {
    379           if((!hwndBubble || WinQueryWindowULong(hwndBubble,0) != hwnd) &&
     380          if((!hwndBubble || WinQueryWindowULong(hwndBubble,QWL_USER) != hwnd) &&
    380381             !WinQueryCapture(HWND_DESKTOP)) {
    381382
     
    548549static VOID FreeViewerMem (HWND hwnd)
    549550{
    550   VIEWDATA *ad = WinQueryWindowPtr(hwnd,0);
     551  VIEWDATA *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    551552
    552553  if(ad) {
     
    568569static HPS InitWindow (HWND hwnd)
    569570{
    570   VIEWDATA     *ad = WinQueryWindowPtr(hwnd,0);
     571  VIEWDATA     *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    571572  HPS          hps = (HPS)0;
    572573  SIZEL        sizel;
     
    626627                       RECTL *Rectl)
    627628{
    628   VIEWDATA       *ad = WinQueryWindowPtr(hwnd,0);
     629  VIEWDATA       *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    629630  POINTL          ptl;
    630631  ULONG           width;
     
    832833    if(hmq2) {
    833834      WinCancelShutdown(hmq2,TRUE);
    834       ad = WinQueryWindowPtr(hwnd,0);
     835      ad = WinQueryWindowPtr(hwnd,QWL_USER);
    835836      if(ad) {
    836837        if(!DosRequestMutexSem(ad->ScanSem,SEM_INDEFINITE_WAIT)) {
     
    984985    if(hmq2) {
    985986      WinCancelShutdown(hmq2,TRUE);
    986       ad = WinQueryWindowPtr(hwnd,0);
     987      ad = WinQueryWindowPtr(hwnd,QWL_USER);
    987988      if(ad) {
    988989        if(!DosRequestMutexSem(ad->ScanSem,SEM_INDEFINITE_WAIT)) {
     
    10821083    if(hmq2) {
    10831084      WinCancelShutdown(hmq2,TRUE);
    1084       ad = WinQueryWindowPtr(hwnd,0);
     1085      ad = WinQueryWindowPtr(hwnd,QWL_USER);
    10851086      if(ad) {
    10861087        ad->relining = TRUE;
     
    12561257    if(hmq2) {
    12571258      WinCancelShutdown(hmq2,TRUE);
    1258       ad = WinQueryWindowPtr(hwnd,0);
     1259      ad = WinQueryWindowPtr(hwnd,QWL_USER);
    12591260      if(ad) {
    12601261        if(!DosRequestMutexSem(ad->ScanSem,SEM_INDEFINITE_WAIT)) {
     
    13521353MRESULT EXPENTRY ViewFrameWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
    13531354{
    1354   PFNWP oldproc = (PFNWP)WinQueryWindowPtr(hwnd,0);
     1355  PFNWP oldproc = (PFNWP)WinQueryWindowPtr(hwnd,QWL_USER);
    13551356
    13561357  switch(msg) {
     
    15251526        HWND hwndClient = *(HWND *)mp2;
    15261527
    1527         WinSetWindowULong(hwnd,0,(ULONG)hwndClient);
    1528         ad = (VIEWDATA *)WinQueryWindowPtr(hwndClient,0);
     1528        WinSetWindowULong(hwnd,QWL_USER,(ULONG)hwndClient);
     1529        ad = (VIEWDATA *)WinQueryWindowPtr(hwndClient,QWL_USER);
    15291530        MLEsetwrap(WinWindowFromID(hwnd,NEWFIND_MLE),FALSE);
    15301531        MLEsetlimit(WinWindowFromID(hwnd,NEWFIND_MLE),SEARCHSTRINGLEN);
     
    15571558            IPT   here = 0;
    15581559            ULONG len;
    1559             HWND  hwndClient = WinQueryWindowULong(hwnd,0);
    1560 
    1561             ad = (VIEWDATA *)WinQueryWindowPtr(hwndClient,0);
     1560            HWND  hwndClient = WinQueryWindowULong(hwnd,QWL_USER);
     1561
     1562            ad = (VIEWDATA *)WinQueryWindowPtr(hwndClient,QWL_USER);
    15621563            memset(s,0,SEARCHSTRINGLEN);
    15631564            WinSendMsg(WinWindowFromID(hwnd,NEWFIND_MLE),
     
    16181619MRESULT EXPENTRY ViewWndProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    16191620{
    1620   VIEWDATA *ad = WinQueryWindowPtr(hwnd,0);
     1621  VIEWDATA *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    16211622
    16221623  switch (msg) {
     
    17841785            oldproc = WinSubclassWindow(ad->hwndFrame,(PFNWP)ViewFrameWndProc);
    17851786            if(oldproc)
    1786                 WinSetWindowPtr(ad->hwndFrame,0,(PVOID)oldproc);
     1787                WinSetWindowPtr(ad->hwndFrame,QWL_USER,(PVOID)oldproc);
    17871788            ad->hps = InitWindow(hwnd);
    17881789            if(_beginthread(LoadFile,NULL,524288,(PVOID)hwnd) != -1) {
     
    38673868          dontclose = ((ad->flags & 4) != 0) ? TRUE : FALSE;
    38683869          FreeViewerMem(hwnd);
    3869           WinSetWindowPtr(hwnd,0,NULL);
     3870          WinSetWindowPtr(hwnd,QWL_USER,NULL);
    38703871          free(ad);
    38713872        }
     
    39493950      if(ad->flags & 16)
    39503951        ad->hex = TRUE;
    3951       WinSetWindowPtr(hwndClient,0,(PVOID)ad);
     3952      WinSetWindowPtr(hwndClient,QWL_USER,(PVOID)ad);
    39523953      if(Firsttime) {
    39533954
     
    40044005      ad->ignoreftp = IgnoreFTP;
    40054006      memcpy(ad->colors,Colors,sizeof(LONG) * COLORS_MAX);
    4006       WinSetWindowPtr(hwndClient,0,(PVOID)ad);
     4007      WinSetWindowPtr(hwndClient,QWL_USER,(PVOID)ad);
    40074008      if(WinSendMsg(hwndClient,UM_SETUP,MPVOID,MPVOID)) {
    40084009//        DosSleep(64L);
  • trunk/dll/notebook.c

    r123 r130  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2004 Steven H.Levine
    10 
    11   Revisions     01 Aug 04 SHL - Rework lstrip/rstrip usage
     9  Copyright (c) 2004, 2005 Steven H.Levine
     10
     11  01 Aug 04 SHL Rework lstrip/rstrip usage
     12  23 May 05 SHL Use QWL_USER
    1213
    1314***********************************************************************/
     
    114115        case DID_CANCEL:
    115116        case DID_OK:
    116           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     117          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    117118          break;
    118119
     
    278279        case DID_CANCEL:
    279280        case DID_OK:
    280           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     281          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    281282          break;
    282283
     
    397398        case DID_CANCEL:
    398399        case DID_OK:
    399           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     400          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    400401          break;
    401402
     
    515516        case DID_CANCEL:
    516517        case DID_OK:
    517           PostMsg((HWND)WinQueryWindowULong(hwnd,0),
     518          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),
    518519                  msg,
    519520                  mp1,
     
    675676        case DID_CANCEL:
    676677        case DID_OK:
    677           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     678          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    678679          break;
    679680
     
    791792        case DID_CANCEL:
    792793        case DID_OK:
    793           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     794          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    794795          break;
    795796
     
    913914        case DID_CANCEL:
    914915        case DID_OK:
    915           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     916          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    916917          break;
    917918
     
    10591060        case DID_CANCEL:
    10601061        case DID_OK:
    1061           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     1062          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    10621063          break;
    10631064
     
    11541155        case DID_CANCEL:
    11551156        case DID_OK:
    1156           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     1157          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    11571158          break;
    11581159
     
    13211322        case DID_CANCEL:
    13221323        case DID_OK:
    1323           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     1324          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    13241325          break;
    13251326
     
    14571458                              (PVOID)&fSeparateParms,
    14581459                              sizeof(BOOL));
    1459           WinSendMsg((HWND)WinQueryWindowULong(hwnd,0),
     1460          WinSendMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),
    14601461                     UM_UNDO,
    14611462                     MPVOID,
     
    15791580        case DID_CANCEL:
    15801581        case DID_OK:
    1581           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     1582          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    15821583          break;
    15831584
     
    17621763        case DID_CANCEL:
    17631764        case DID_OK:
    1764           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     1765          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    17651766          break;
    17661767
     
    19221923        case DID_CANCEL:
    19231924        case DID_OK:
    1924           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     1925          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    19251926          break;
    19261927
     
    20872088        case DID_CANCEL:
    20882089        case DID_OK:
    2089           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     2090          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    20902091          break;
    20912092
     
    26262627          fExternalINIs = TRUE;
    26272628          fUserListSwitches = TRUE;
    2628           WinSendMsg((HWND)WinQueryWindowULong(hwnd,0),UM_UNDO,MPVOID,MPVOID);
     2629          WinSendMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),UM_UNDO,MPVOID,MPVOID);
    26292630          if(hwndTree) {
    26302631
     
    27222723          fExternalINIs = TRUE;
    27232724          fUserListSwitches = TRUE;
    2724           WinSendMsg((HWND)WinQueryWindowULong(hwnd,0),UM_UNDO,MPVOID,MPVOID);
     2725          WinSendMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),UM_UNDO,MPVOID,MPVOID);
    27252726          if(hwndTree) {
    27262727
     
    27662767        case DID_CANCEL:
    27672768        case DID_OK:
    2768           PostMsg((HWND)WinQueryWindowULong(hwnd,0),msg,mp1,mp2);
     2769          PostMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),msg,mp1,mp2);
    27692770          return 0;
    27702771
     
    28332834        }
    28342835      }
    2835       WinSendMsg((HWND)WinQueryWindowULong(hwnd,0),
     2836      WinSendMsg((HWND)WinQueryWindowULong(hwnd,QWL_USER),
    28362837                 UM_UNDO,
    28372838                 MPVOID,
  • trunk/dll/seeall.c

    r84 r130  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2002 Steven H.Levine
    10 
    11   Revisions     16 Oct 02 SHL - Handle large partitions
    12                 25 Nov 03 SHL - StartSeeAll: avoid forgetting startpath
    13                 06 Dec 03 SHL - StartSeeAll: correct malloc arg oops
     9  Copyright (c) 2001, 2005 Steven H.Levine
     10
     11  16 Oct 02 SHL Handle large partitions
     12  25 Nov 03 SHL StartSeeAll: avoid forgetting startpath
     13  06 Dec 03 SHL StartSeeAll: correct malloc arg oops
     14  23 May 05 SHL Use QWL_USER
    1415
    1516***********************************************************************/
     
    220221        CHAR         **files = NULL,**list = (CHAR **)mp2,path[CCHMAXPATH];
    221222        INT            numfiles = 0,numalloc = 0,plen = 0;
    222         HWND           hwndFrame = WinQueryWindowULong(hwnd,0);
     223        HWND           hwndFrame = WinQueryWindowULong(hwnd,QWL_USER);
    223224        CHAR           message[CCHMAXPATH * 2],wildname[CCHMAXPATH];
    224225        register INT   x;
     
    12601261        if(hwndObj) {
    12611262          ad->hwndObj = hwndObj;
    1262           WinSetWindowULong(hwndObj,0,ad->hwndFrame);
     1263          WinSetWindowULong(hwndObj,QWL_USER,ad->hwndFrame);
    12631264          priority_normal();
    12641265          while(WinGetMsg(hab2,&qmsg2,(HWND)0,0,0))
     
    12851286  ULONG          ul;
    12861287  BOOL           ret;
    1287   ALLDATA       *pAD = WinQueryWindowPtr(hwnd,0);
     1288  ALLDATA       *pAD = WinQueryWindowPtr(hwnd,QWL_USER);
    12881289
    12891290  memset(&mask,0,sizeof(mask));
     
    14121413static VOID FreeAllFilesList (HWND hwnd) {
    14131414
    1414   ALLDATA       *ad = WinQueryWindowPtr(hwnd,0);
     1415  ALLDATA       *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    14151416  register ULONG x;
    14161417
     
    14341435static CHAR ** BuildAList (HWND hwnd) {
    14351436
    1436   ALLDATA       *ad = WinQueryWindowPtr(hwnd,0);
     1437  ALLDATA       *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    14371438  register ULONG x,y,z = 0;
    14381439  CHAR         **list = NULL;
     
    14611462  /* Marks only unfiltered files */
    14621463
    1463   ALLDATA       *pAD = WinQueryWindowPtr(hwnd,0);
     1464  ALLDATA       *pAD = WinQueryWindowPtr(hwnd,QWL_USER);
    14641465  register ULONG x,y,z;
    14651466  ULONG         ul;
     
    15321533  /* Marks files whether filtered or not */
    15331534
    1534   ALLDATA       *pAD = WinQueryWindowPtr(hwnd,0);
     1535  ALLDATA       *pAD = WinQueryWindowPtr(hwnd,QWL_USER);
    15351536  register ULONG x,z;
    15361537  ULONG         ul;
     
    16021603  /* Updates files in the list */
    16031604
    1604   ALLDATA       *ad = WinQueryWindowPtr(hwnd,0);
     1605  ALLDATA       *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    16051606  register ULONG x,z;
    16061607  BOOL           ret,didone = FALSE;
     
    17951796static VOID ReSort (HWND hwnd) {
    17961797
    1797   ALLDATA       *pAD = WinQueryWindowPtr(hwnd,0);
     1798  ALLDATA       *pAD = WinQueryWindowPtr(hwnd,QWL_USER);
    17981799  register ULONG x,y;
    17991800  ULONG         ul;
     
    18311832  HAB            hab2 = (HAB)0;
    18321833  HMQ            hmq2 = (HMQ)0;
    1833   ALLDATA       *ad = WinQueryWindowPtr(hwnd,0);
     1834  ALLDATA       *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    18341835
    18351836  if(!DosRequestMutexSem(ad->ScanSem,SEM_INDEFINITE_WAIT)) {
     
    19471948  register ULONG x,z;
    19481949  BOOL           ret;
    1949   ALLDATA       *ad = WinQueryWindowPtr(hwnd,0);
     1950  ALLDATA       *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    19501951  CHAR          *p;
    19511952
     
    20242025static ULONG RemoveDeleted (HWND hwnd) {
    20252026
    2026   ALLDATA       *pAD = WinQueryWindowPtr(hwnd,0);
     2027  ALLDATA       *pAD = WinQueryWindowPtr(hwnd,QWL_USER);
    20272028  ULONG         oldaffiles = pAD->affiles;
    20282029  register ULONG x,y;
     
    20732074static VOID DoADir (HWND hwnd,CHAR *pathname) {
    20742075
    2075   ALLDATA       *ad = WinQueryWindowPtr(hwnd,0);
     2076  ALLDATA       *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    20762077  CHAR          *filename,*enddir;
    20772078  FILEFINDBUF3  *pffb,*ffb;
     
    21842185  HAB       hab2 = (HAB)0;
    21852186  HMQ       hmq2 = (HMQ)0;
    2186   ALLDATA  *ad = WinQueryWindowPtr(hwnd,0);
     2187  ALLDATA  *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    21872188
    21882189  if(!DosRequestMutexSem(ad->ScanSem,SEM_INDEFINITE_WAIT)) {
     
    22532254
    22542255        ad = (ALLDATA *)mp2;
    2255         WinSetWindowPtr(hwnd,0,mp2);
     2256        WinSetWindowPtr(hwnd,QWL_USER,mp2);
    22562257        DosError(FERR_DISABLEHARDERR);
    22572258        if(!DosQCurDisk(&ulDriveNum,&ulDriveMap)) {
     
    22962297            SHORT     sSelect;
    22972298            CHAR      filename[3];
    2298             ALLDATA  *ad = WinQueryWindowPtr(hwnd,0);
     2299            ALLDATA  *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    22992300
    23002301            memset(ad->drvsflags,0,sizeof(ad->drvsflags));
     
    23432344static HPS InitWindow (HWND hwnd) {
    23442345
    2345   ALLDATA     *ad = WinQueryWindowPtr(hwnd,0);
     2346  ALLDATA     *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    23462347  HPS          hps = (HPS)0;
    23472348  SIZEL        sizel;
     
    23982399                       RECTL *Rectl) {
    23992400
    2400   ALLDATA *ad = WinQueryWindowPtr(hwnd,0);
     2401  ALLDATA *ad = WinQueryWindowPtr(hwnd,QWL_USER);
    24012402  POINTL   ptl;
    24022403  CHAR     szBuff[CCHMAXPATH + 80];
     
    24992500MRESULT EXPENTRY SeeFrameWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
    25002501
    2501   PFNWP oldproc = (PFNWP)WinQueryWindowPtr(hwnd,0);
     2502  PFNWP oldproc = (PFNWP)WinQueryWindowPtr(hwnd,QWL_USER);
    25022503
    25032504  switch(msg) {
     
    25872588MRESULT EXPENTRY SeeAllWndProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) {
    25882589
    2589   ALLDATA *pAD = WinQueryWindowPtr(hwnd,0);
     2590  ALLDATA *pAD = WinQueryWindowPtr(hwnd,QWL_USER);
    25902591  ULONG   ul;
    25912592
     
    25932594    case WM_CREATE:
    25942595      // fprintf(stderr,"Seeall: WM_CREATE\n");
    2595       WinSetWindowPtr(hwnd,0,NULL);
     2596      WinSetWindowPtr(hwnd,QWL_USER,NULL);
    25962597      pAD = malloc(sizeof(ALLDATA));
    25972598      if(pAD) {
     
    26032604        pAD->mask.fNoDirs = TRUE;
    26042605        *(pAD->mask.prompt) = 0;
    2605         WinSetWindowPtr(hwnd,0,(PVOID)pAD);
     2606        WinSetWindowPtr(hwnd,QWL_USER,(PVOID)pAD);
    26062607        pAD->compare = comparenames;
    26072608        if(Firsttime) {
     
    27252726                                          (PFNWP)SeeFrameWndProc);
    27262727              if(oldproc)
    2727                 WinSetWindowPtr(WinQueryWindow(hwnd,QW_PARENT),0,
     2728                WinSetWindowPtr(WinQueryWindow(hwnd,QW_PARENT),QWL_USER,
    27282729                                (PVOID)oldproc);
    27292730            }
  • trunk/dll/tools.c

    r123 r130  
    77
    88  Copyright (c) 1994-97 M. Kimes
    9   Copyright (c) 2004 Steven H.Levine
    10 
    11   Revisions     01 Aug 04 SHL - Rework lstrip/rstrip usage
     9  Copyright (c) 2004, 2005 Steven H.Levine
     10
     11  01 Aug 04 SHL Rework lstrip/rstrip usage
     12  23 May 05 SHL Use QWL_USER
    1213
    1314***********************************************************************/
     
    602603  switch(msg) {
    603604    case WM_INITDLG:
    604       WinSetWindowPtr(hwnd,0,mp2);
     605      WinSetWindowPtr(hwnd,QWL_USER,mp2);
    605606      if(mp2) {
    606607        WinSetWindowText(hwnd,GetPString(IDS_EDITTOOLTEXT));
     
    956957    case WM_INITDLG:
    957958      if(mp2)
    958         WinSetWindowULong(hwnd,0,TRUE);
     959        WinSetWindowULong(hwnd,QWL_USER,TRUE);
    959960      else {
    960         WinSetWindowULong(hwnd,0,FALSE);
     961        WinSetWindowULong(hwnd,QWL_USER,FALSE);
    961962        WinSetWindowText(hwnd,
    962963                         GetPString(IDS_LOADTOOLBOXTITLETEXT));
     
    10791080        case DID_OK:
    10801081          {
    1081             BOOL saving = WinQueryWindowULong(hwnd,0);
     1082            BOOL saving = WinQueryWindowULong(hwnd,QWL_USER);
    10821083            CHAR temptools[CCHMAXPATH];
    10831084
  • trunk/dll/viewer.c

    r2 r130  
    1 /**************************************************************************/
    2 /*                  MLE text editor/viewer source code                    */
    3 /*                   copyright (c) 1993-97 by M. Kimes                  */
    4 /*                        All rights reserved                             */
    5 /**************************************************************************/
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  MLE text editor/viewer
     7
     8  Copyright (c) 1993-97 M. Kimes
     9  Copyright (c) 2005 Steven H.Levine
     10
     11  23 May 05 SHL Use QWL_USER
     12
     13***********************************************************************/
    614
    715#define INCL_DOS
     
    144152    }
    145153    MLEsetreadonly(hwndMLE,((flags & 1) != 0));
    146     WinSetWindowPtr(hwnd,0,(PVOID)vw);
     154    WinSetWindowPtr(hwnd,QWL_USER,(PVOID)vw);
    147155    if(!PostMsg(hwnd,
    148156                UM_SETUP,
     
    160168MRESULT EXPENTRY MLESubProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
    161169
    162   PFNWP       oldproc = (PFNWP)WinQueryWindowPtr(hwnd,0);
     170  PFNWP       oldproc = (PFNWP)WinQueryWindowPtr(hwnd,QWL_USER);
    163171  XMLEWNDPTR *vw;
    164172
     
    170178
    171179    case WM_CHAR:
    172       vw = WinQueryWindowPtr(WinQueryWindow(hwnd,QW_PARENT),0);
     180      vw = WinQueryWindowPtr(WinQueryWindow(hwnd,QW_PARENT),QWL_USER);
    173181      if(vw && vw->size == sizeof(XMLEWNDPTR) && vw->hex == 1) {
    174182        if(!MLEgetreadonly(hwnd)) {
     
    249257
    250258    case WM_MENUEND:
    251       vw = WinQueryWindowPtr(WinQueryWindow(hwnd,QW_PARENT),0);
     259      vw = WinQueryWindowPtr(WinQueryWindow(hwnd,QW_PARENT),QWL_USER);
    252260      if(vw && vw->size == sizeof(XMLEWNDPTR)) {
    253261        if(vw->hwndPopupMenu == (HWND)mp2) {
     
    259267
    260268    case WM_CONTEXTMENU:
    261       vw = WinQueryWindowPtr(WinQueryWindow(hwnd,QW_PARENT),0);
     269      vw = WinQueryWindowPtr(WinQueryWindow(hwnd,QW_PARENT),QWL_USER);
    262270      if(vw && vw->size == sizeof(XMLEWNDPTR)) {
    263271        if(!vw->hwndPopupMenu)
     
    301309  if(msg != WM_CREATE &&
    302310     msg != UM_SETUP)
    303     vw = (XMLEWNDPTR *)WinQueryWindowPtr(hwnd,0);
     311    vw = (XMLEWNDPTR *)WinQueryWindowPtr(hwnd,QWL_USER);
    304312  else
    305313    vw = NULL;
     
    377385
    378386    case UM_SETUP2:
    379       vw = WinQueryWindowPtr(hwnd,0);
     387      vw = WinQueryWindowPtr(hwnd,QWL_USER);
    380388      if(vw) {
    381389
     
    417425
    418426    case UM_SETUP:
    419       vw = WinQueryWindowPtr(hwnd,0);
     427      vw = WinQueryWindowPtr(hwnd,QWL_USER);
    420428      if(vw) {
    421429        vw->hab = WinQueryAnchorBlock(hwnd);
     
    14051413            WinDestroyAccelTable(vw->accel);
    14061414          dontclose = vw->dontclose;
    1407           WinSetWindowPtr(hwnd,0,NULL);
     1415          WinSetWindowPtr(hwnd,QWL_USER,NULL);
    14081416          if(vw->hwndRestore) {
    14091417
  • trunk/dll/winlist.c

    r2 r130  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  Window List Dialog
     7
     8  Copyright (c) 1993-97 M. Kimes
     9  Copyright (c) 2005 Steven H.Levine
     10
     11  23 May 05 SHL Use QWL_USER
     12
     13***********************************************************************/
     14
    115#define INCL_DOS
    216#define INCL_WIN
     
    1428#pragma alloc_text(WINLIST,WindowList,WinListDlgProc)
    1529
    16 
    17 MRESULT EXPENTRY WinListDlgProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
    18 
     30MRESULT EXPENTRY WinListDlgProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
     31{
    1932  static HWND Me = (HWND)0;
    2033  SHORT       sSelect;
     
    3548
    3649        Me = hwnd;
    37         WinSetWindowULong(hwnd,0,*(HWND *)mp2);
     50        WinSetWindowULong(hwnd,QWL_USER,*(HWND *)mp2);
    3851        henum = WinBeginEnumWindows(*(HWND *)mp2);
    3952        while((hwndChild = WinGetNextWindow(henum)) != NULLHANDLE) {
     
    167180        case DID_OK:
    168181          {
    169             HWND hwndActive = (HWND)WinQueryWindowULong(hwnd,0);
     182            HWND hwndActive = (HWND)WinQueryWindowULong(hwnd,QWL_USER);
    170183
    171184            hwndActive = WinQueryActiveWindow(hwndActive);
     
    192205                  if(!(swp.fl & SWP_MINIMIZE) &&
    193206                     (swp.cx == 0 || swp.cy == 0)) {
    194                     GetNextWindowPos((HWND)WinQueryWindowULong(hwnd,0),&swp,
     207                    GetNextWindowPos((HWND)WinQueryWindowULong(hwnd,QWL_USER),&swp,
    195208                                     NULL,NULL);
    196209                    WinSetWindowPos(HwndC,HWND_TOP,swp.x,swp.y,swp.cx,swp.cy,
     
    253266
    254267
    255 VOID WindowList (HWND hwnd) {
    256 
     268VOID WindowList (HWND hwnd)
     269{
    257270  WinDlgBox(HWND_DESKTOP,HWND_DESKTOP,WinListDlgProc,FM3ModHandle,WLIST_FRAME,
    258271            MPFROMP(&hwnd));
Note: See TracChangeset for help on using the changeset viewer.