Ignore:
Timestamp:
Jul 18, 1999, 12:39:52 PM (26 years ago)
Author:
sandervl
Message:

Lots of changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/user32.cpp

    r322 r325  
    1 /* $Id: user32.cpp,v 1.4 1999-07-17 12:49:41 cbratschi Exp $ */
     1/* $Id: user32.cpp,v 1.5 1999-07-18 10:39:51 sandervl Exp $ */
    22
    33/*
     
    216216}
    217217//******************************************************************************
    218 //******************************************************************************
    219 BOOL WIN32API IsDlgButtonChecked( HWND arg1, UINT  arg2)
    220 {
    221 #ifdef DEBUG
    222     WriteLog("USER32:  IsDlgButtonChecked\n");
    223 #endif
    224     //CB: get button state
    225     return (BOOL)SendDlgItemMessageA(arg1,arg2,BM_GETCHECK,0,0);
    226 }
    227 //******************************************************************************
    228 //******************************************************************************
    229 int WIN32API GetWindowTextLengthA( HWND arg1)
    230 {
    231     dprintf(("USER32:  GetWindowTextLength\n"));
    232     //win32 to OS/2 handle
    233     //return OSLibWinQueryWindowTextLength(arg1);
    234     return O32_GetWindowTextLength(arg1);
    235 }
    236 //******************************************************************************
    237 //******************************************************************************
    238 int WIN32API GetWindowTextA( HWND arg1, LPSTR arg2, int  arg3)
    239 {
    240     dprintf(("USER32:  GetWindowTextA\n"));
    241     //win32 to OS/2 handle
    242     //return OSLibWinQueryWindowText(arg1,arg3,arg2);
    243     return O32_GetWindowText(arg1, arg2, arg3);
    244 }
    245 //******************************************************************************
    246218
    247219/*******************************************************************
     
    264236//******************************************************************************
    265237//******************************************************************************
    266 HWND WIN32API GetNextDlgTabItem( HWND arg1, HWND arg2, BOOL  arg3)
    267 {
    268     dprintf(("USER32:  GetNextDlgTabItem\n"));
    269     //get next WS_TABSTOP
    270     return O32_GetNextDlgTabItem(arg1, arg2, arg3);
    271 }
    272 //******************************************************************************
    273 //******************************************************************************
    274238HWND WIN32API GetFocus(void)
    275239{
     
    277241    //return OS2LibWinQueryFocus(HWND_DESKTOP);
    278242    return O32_GetFocus();
    279 }
    280 //******************************************************************************
    281 //******************************************************************************
    282 HWND WIN32API GetDlgItem(HWND arg1, int  arg2)
    283 {
    284  HWND rc;
    285     //return OSLibWinWindowFromID(arg1,arg2);
    286     rc = O32_GetDlgItem(arg1, arg2);
    287     dprintf(("USER32:  GetDlgItem %d returned %d\n", arg2, rc));
    288     return(rc);
    289 }
    290 //******************************************************************************
    291 //******************************************************************************
    292 int WIN32API GetDlgCtrlID( HWND arg1)
    293 {
    294     dprintf(("USER32:  GetDlgCtrlID\n"));
    295     //return OSLibWinQueryWindowUShort(arg1,QWS_ID);
    296     //use internal ID -> DWORD
    297     return O32_GetDlgCtrlID(arg1);
    298243}
    299244//******************************************************************************
     
    318263    delete callback;
    319264  return(rc);
    320 }
    321 //******************************************************************************
    322 //******************************************************************************
    323 BOOL WIN32API EndDialog( HWND arg1, int  arg2)
    324 {
    325  BOOL rc;
    326 
    327     dprintf(("USER32:  EndDialog\n"));
    328     //return OSLibDismissDialog(arg1,arg2);
    329     rc = O32_EndDialog(arg1, arg2);
    330     return(rc);
    331265}
    332266//******************************************************************************
     
    361295//******************************************************************************
    362296//******************************************************************************
    363 BOOL WIN32API CheckDlgButton( HWND arg1, int arg2, UINT  arg3)
    364 {
    365 #ifdef DEBUG
    366     WriteLog("USER32:  CheckDlgButton\n");
    367 #endif
    368     //CB: set button state
    369     return (BOOL)SendDlgItemMessageA(arg1,arg2,BM_SETCHECK,arg3,0);
    370 }
    371 //******************************************************************************
    372 //******************************************************************************
    373297HWND WIN32API SetFocus( HWND arg1)
    374298{
     
    379303//******************************************************************************
    380304//******************************************************************************
    381 int WIN32API ReleaseDC( HWND arg1, HDC  arg2)
    382 {
    383 #ifdef DEBUG
    384     WriteLog("USER32:  ReleaseDC\n");
    385 #endif
    386     //return OSLibWinReleasePS(arg2);
    387     return O32_ReleaseDC(arg1, arg2);
    388 }
    389 //******************************************************************************
    390 //******************************************************************************
    391305BOOL WIN32API InvalidateRect(HWND arg1, const RECT *arg2, BOOL arg3)
    392306{
     
    412326//******************************************************************************
    413327//******************************************************************************
    414 HDC WIN32API GetDC( HWND arg1)
    415 {
    416  HDC hdc;
    417 
    418    //hdc = OSLibWinGetPS(arg1);
    419    hdc = O32_GetDC(arg1);
    420 #ifdef DEBUG
    421    WriteLog("USER32:  GetDC of %X returns %X\n", arg1, hdc);
    422 #endif
    423    return(hdc);
    424 }
    425 //******************************************************************************
    426 //******************************************************************************
    427 HDC WIN32API GetDCEx(HWND arg1, HRGN arg2, DWORD arg3)
    428 {
    429 #ifdef DEBUG
    430     WriteLog("USER32:  GetDCEx\n");
    431 #endif
    432     //return OSLibGetDC(arg1);
    433     //change values
    434     return O32_GetDCEx(arg1, arg2, arg3);
    435 }
    436 //******************************************************************************
    437 //******************************************************************************
    438 BOOL WIN32API EndPaint( HWND arg1, const PAINTSTRUCT * arg2)
    439 {
    440 #ifdef DEBUG
    441     WriteLog("USER32:  EndPaint\n");
    442 #endif
    443     //return OSLibWinEndPaint(arg2->hdc);
    444     return O32_EndPaint(arg1, arg2);
    445 }
    446 //******************************************************************************
    447 //******************************************************************************
    448 //******************************************************************************
    449 //******************************************************************************
    450 HDC WIN32API BeginPaint(HWND arg1, PPAINTSTRUCT  arg2)
    451 {
    452     dprintf(("USER32: BeginPaint %X\n", arg2));
    453     //return OSLibWinBeginPaint(arg1,);
    454     //CB: emulate
    455     return O32_BeginPaint(arg1, arg2);
    456 }
    457328//******************************************************************************
    458329//******************************************************************************
     
    610481//******************************************************************************
    611482//******************************************************************************
    612 UINT WIN32API GetDlgItemTextA(HWND arg1, int arg2, LPSTR arg3, UINT arg4)
    613 {
    614  UINT rc;
    615 
    616     //WinQueryDlgItemText(arg1,arg2,arg4,arg3);
    617     rc = O32_GetDlgItemText(arg1, arg2, arg3, arg4);
    618 #ifdef DEBUG
    619     if(rc)
    620         WriteLog("USER32:  GetDlgItemTextA returned %s\n", arg3);
    621     else    WriteLog("USER32:  GetDlgItemTextA returned 0 (%d)\n", GetLastError());
    622 #endif
    623     return(rc);
    624 }
    625 //******************************************************************************
    626 //******************************************************************************
    627483int WIN32API ShowCursor( BOOL arg1)
    628484{
     
    647503
    648504    return TRUE;
    649 }
    650 //******************************************************************************
    651 //******************************************************************************
    652 BOOL WIN32API SetDlgItemInt( HWND arg1, int arg2, UINT arg3, BOOL  arg4)
    653 {
    654 #ifdef DEBUG
    655     WriteLog("USER32:  SetDlgItemInt\n");
    656 #endif
    657     //get item text and translate to int
    658     return O32_SetDlgItemInt(arg1, arg2, arg3, arg4);
    659 }
    660 //******************************************************************************
    661 //******************************************************************************
    662 BOOL WIN32API SetDlgItemTextA( HWND arg1, int arg2, LPCSTR  arg3)
    663 {
    664 #ifdef DEBUG
    665     WriteLog("USER32:  SetDlgItemText to %s\n", arg3);
    666 #endif
    667     //WinSetDlgItemText(arg1,arg2,arg3);
    668     return O32_SetDlgItemText(arg1, arg2, arg3);
    669505}
    670506//******************************************************************************
     
    1000836//******************************************************************************
    1001837//******************************************************************************
    1002 int WIN32API DlgDirListA( HWND arg1, LPSTR arg2, int arg3, int arg4, UINT  arg5)
    1003 {
    1004 #ifdef DEBUG
    1005     WriteLog("USER32:  DlgDirListA\n");
    1006 #endif
    1007     return O32_DlgDirList(arg1, arg2, arg3, arg4, arg5);
    1008 }
    1009 //******************************************************************************
    1010 //******************************************************************************
    1011 int WIN32API DlgDirListComboBoxA( HWND arg1, LPSTR arg2, int arg3, int arg4, UINT  arg5)
    1012 {
    1013 #ifdef DEBUG
    1014     WriteLog("USER32:  DlgDirListComboBoxA\n");
    1015 #endif
    1016     return O32_DlgDirListComboBox(arg1, arg2, arg3, arg4, arg5);
    1017 }
    1018 //******************************************************************************
    1019 //******************************************************************************
    1020 int WIN32API DlgDirListComboBoxW( HWND arg1, LPWSTR arg2, int arg3, int arg4, UINT  arg5)
    1021 {
    1022 #ifdef DEBUG
    1023     WriteLog("USER32:  DlgDirListComboBoxW NOT WORKING\n");
    1024 #endif
    1025     // NOTE: This will not work as is (needs UNICODE support)
    1026     return 0;
    1027 //    return O32_DlgDirListComboBox(arg1, arg2, arg3, arg4, arg5);
    1028 }
    1029 //******************************************************************************
    1030 //******************************************************************************
    1031 int WIN32API DlgDirListW( HWND arg1, LPWSTR arg2, int arg3, int arg4, UINT  arg5)
    1032 {
    1033 #ifdef DEBUG
    1034     WriteLog("USER32:  DlgDirListW NOT WORKING\n");
    1035 #endif
    1036     // NOTE: This will not work as is (needs UNICODE support)
    1037     return 0;
    1038 //    return O32_DlgDirList(arg1, arg2, arg3, arg4, arg5);
    1039 }
    1040 //******************************************************************************
    1041 //******************************************************************************
    1042 BOOL WIN32API DlgDirSelectComboBoxExA( HWND arg1, LPSTR arg2, int arg3, int  arg4)
    1043 {
    1044 #ifdef DEBUG
    1045     WriteLog("USER32:  DlgDirSelectComboBoxExA\n");
    1046 #endif
    1047     return O32_DlgDirSelectComboBoxEx(arg1, arg2, arg3, arg4);
    1048 }
    1049 //******************************************************************************
    1050 //******************************************************************************
    1051 BOOL WIN32API DlgDirSelectComboBoxExW( HWND arg1, LPWSTR arg2, int arg3, int  arg4)
    1052 {
    1053 #ifdef DEBUG
    1054     WriteLog("USER32:  DlgDirSelectComboBoxExW NOT WORKING\n");
    1055 #endif
    1056     // NOTE: This will not work as is (needs UNICODE support)
    1057     return 0;
    1058 //    return O32_DlgDirSelectComboBoxEx(arg1, arg2, arg3, arg4);
    1059 }
    1060 //******************************************************************************
    1061 //******************************************************************************
    1062 BOOL WIN32API DlgDirSelectExA( HWND arg1, LPSTR arg2, int arg3, int  arg4)
    1063 {
    1064 #ifdef DEBUG
    1065     WriteLog("USER32:  DlgDirSelectExA\n");
    1066 #endif
    1067     return O32_DlgDirSelectEx(arg1, arg2, arg3, arg4);
    1068 }
    1069 //******************************************************************************
    1070 //******************************************************************************
    1071 BOOL WIN32API DlgDirSelectExW( HWND arg1, LPWSTR arg2, int arg3, int  arg4)
    1072 {
    1073 #ifdef DEBUG
    1074     WriteLog("USER32:  DlgDirSelectExW NOT WORKING\n");
    1075 #endif
    1076     // NOTE: This will not work as is (needs UNICODE support)
    1077     return 0;
    1078 //    return O32_DlgDirSelectEx(arg1, arg2, arg3, arg4);
    1079 }
    1080 //******************************************************************************
    1081 //******************************************************************************
    1082838BOOL WIN32API EmptyClipboard(void)
    1083839{
     
    1122878//******************************************************************************
    1123879//******************************************************************************
    1124 int WIN32API EnumPropsA(HWND arg1, PROPENUMPROCA arg2)
    1125 {
    1126 #ifdef DEBUG
    1127     WriteLog("USER32:  EnumPropsA DOES NOT WORK\n");
    1128 #endif
    1129     //calling convention problems
    1130     return 0;
    1131 //    return O32_EnumProps(arg1, (PROPENUMPROC_O32)arg2);
    1132 }
    1133 //******************************************************************************
    1134 //******************************************************************************
    1135 int WIN32API EnumPropsExA( HWND arg1, PROPENUMPROCEXA arg2, LPARAM  arg3)
    1136 {
    1137 #ifdef DEBUG
    1138     WriteLog("USER32:  EnumPropsExA DOES NOT WORK\n");
    1139 #endif
    1140     //calling convention problems
    1141     return 0;
    1142 //    return O32_EnumPropsEx(arg1, arg2, (PROPENUMPROCEX_O32)arg3);
    1143 }
    1144 //******************************************************************************
    1145 //******************************************************************************
    1146 int WIN32API EnumPropsExW( HWND arg1, PROPENUMPROCEXW arg2, LPARAM  arg3)
    1147 {
    1148 #ifdef DEBUG
    1149     WriteLog("USER32:  EnumPropsExW\n");
    1150 #endif
    1151     // NOTE: This will not work as is (needs UNICODE support)
    1152     //calling convention problems
    1153     return 0;
    1154 //    return O32_EnumPropsEx(arg1, arg2, arg3);
    1155 }
    1156 //******************************************************************************
    1157 //******************************************************************************
    1158 int WIN32API EnumPropsW( HWND arg1, PROPENUMPROCW  arg2)
    1159 {
    1160 #ifdef DEBUG
    1161     WriteLog("USER32:  EnumPropsW\n");
    1162 #endif
    1163     // NOTE: This will not work as is (needs UNICODE support)
    1164     //calling convention problems
    1165     return 0;
    1166 //    return O32_EnumProps(arg1, arg2);
    1167 }
    1168 //******************************************************************************
    1169 //******************************************************************************
    1170880BOOL WIN32API EnumWindows(WNDENUMPROC lpfn, LPARAM lParam)
    1171881{
     
    13301040//******************************************************************************
    13311041//******************************************************************************
    1332 DWORD WIN32API GetDialogBaseUnits(void)
    1333 {
    1334 #ifdef DEBUG
    1335     WriteLog("USER32:  GetDialogBaseUnits\n");
    1336 #endif
    1337     return O32_GetDialogBaseUnits();
    1338 }
    1339 //******************************************************************************
    1340 //******************************************************************************
    1341 UINT WIN32API GetDlgItemInt( HWND arg1, int arg2, PBOOL arg3, BOOL  arg4)
    1342 {
    1343 #ifdef DEBUG
    1344     WriteLog("USER32:  GetDlgItemInt\n");
    1345 #endif
    1346     return O32_GetDlgItemInt(arg1, arg2, arg3, arg4);
    1347 }
    1348 
    1349 
    1350 /*****************************************************************************
    1351  * Name      : UINT WIN32API GetDlgItemTextW
    1352  * Purpose   : Determine the text of a window control
    1353  * Parameters: HWND   arg1
    1354  *             int    arg2
    1355  *             LPWSTR arg3
    1356  *             UINT   arg4
    1357  * Variables :
    1358  * Result    :
    1359  * Remark    :
    1360  * Status    : UNTESTED UNKNOWN STUB
    1361  *
    1362  * Author    : Patrick Haller [Wed, 1998/06/16 11:55]
    1363  *****************************************************************************/
    1364 
    1365 UINT WIN32API GetDlgItemTextW(HWND   arg1,
    1366                               int    arg2,
    1367                               LPWSTR arg3,
    1368                               UINT   arg4)
    1369 {
    1370   LPSTR lpBuffer;                   /* temporary buffer for the ascii result */
    1371   UINT  uiResult;                   /* return value of the ascii variant     */
    1372 
    1373   dprintf(("USER32: GetDlgItemTextW(%08xh,%08xh,%08xh,%08xh)\n",
    1374            arg1,
    1375            arg2,
    1376            arg3,
    1377            arg4));
    1378 
    1379 
    1380   lpBuffer = (LPSTR)malloc(arg4);              /* allocate temporary buffer */
    1381   uiResult = GetDlgItemTextA(arg1,             /* call ascii variant        */
    1382                              arg2,
    1383                              lpBuffer,
    1384                              arg4);
    1385 
    1386   AsciiToUnicodeN(lpBuffer,                /* now convert result to unicode */
    1387                   arg3,
    1388                   arg4);
    1389 
    1390   free(lpBuffer);                              /* free the temporary buffer */
    1391 
    1392   return (uiResult);                                       /* OK, that's it */
    1393 }
    1394 
    1395 
    1396 //******************************************************************************
    1397 //******************************************************************************
    13981042UINT WIN32API GetDoubleClickTime(void)
    13991043{
     
    14631107//******************************************************************************
    14641108//******************************************************************************
    1465 HWND WIN32API GetNextDlgGroupItem( HWND arg1, HWND arg2, BOOL  arg3)
    1466 {
    1467 #ifdef DEBUG
    1468     WriteLog("USER32:  GetNextDlgGroupItem\n");
    1469 #endif
    1470     return O32_GetNextDlgGroupItem(arg1, arg2, arg3);
    1471 }
    1472 //******************************************************************************
    1473 //******************************************************************************
    14741109HWND WIN32API GetOpenClipboardWindow(void)
    14751110{
     
    14871122#endif
    14881123    return O32_GetPriorityClipboardFormat(arg1, arg2);
    1489 }
    1490 //******************************************************************************
    1491 //******************************************************************************
    1492 HANDLE WIN32API GetPropA( HWND arg1, LPCSTR  arg2)
    1493 {
    1494 #ifdef DEBUG
    1495     if((int)arg2 >> 16 != 0)
    1496      WriteLog("USER32:  GetPropA %s\n", arg2);
    1497     else WriteLog("USER32:  GetPropA %X\n", arg2);
    1498 #endif
    1499     return O32_GetProp(arg1, arg2);
    1500 }
    1501 //******************************************************************************
    1502 //******************************************************************************
    1503 HANDLE WIN32API GetPropW(HWND arg1, LPCWSTR arg2)
    1504 {
    1505  BOOL  handle;
    1506  char *astring;
    1507 
    1508     if((int)arg2 >> 16 != 0)
    1509          astring = UnicodeToAsciiString((LPWSTR)arg2);
    1510     else astring = (char *)arg2;
    1511 #ifdef DEBUG
    1512     if((int)arg2 >> 16 != 0)
    1513          WriteLog("USER32:  GetPropW %s\n", astring);
    1514     else WriteLog("USER32:  GetPropW %X\n", astring);
    1515 #endif
    1516     handle = GetPropA(arg1, (LPCSTR)astring);
    1517     if((int)arg2 >> 16 != 0)
    1518         FreeAsciiString(astring);
    1519 
    1520     return(handle);
    15211124}
    15221125//******************************************************************************
     
    17661369//******************************************************************************
    17671370//******************************************************************************
    1768 HANDLE WIN32API RemovePropA( HWND arg1, LPCSTR  arg2)
    1769 {
    1770 #ifdef DEBUG
    1771     WriteLog("USER32:  RemovePropA\n");
    1772 #endif
    1773     return O32_RemoveProp(arg1, arg2);
    1774 }
    1775 //******************************************************************************
    1776 //******************************************************************************
    1777 HANDLE WIN32API RemovePropW( HWND arg1, LPCWSTR  arg2)
    1778 {
    1779  char *astring = UnicodeToAsciiString((LPWSTR)arg2);
    1780  HANDLE rc;
    1781 
    1782 #ifdef DEBUG
    1783     WriteLog("USER32:  RemovePropW\n");
    1784 #endif
    1785     rc = O32_RemoveProp(arg1, astring);
    1786     FreeAsciiString(astring);
    1787     return rc;
    1788 }
    1789 //******************************************************************************
    1790 //******************************************************************************
    17911371BOOL WIN32API ScreenToClient( HWND arg1, LPPOINT  arg2)
    17921372{
     
    18551435//******************************************************************************
    18561436//******************************************************************************
    1857 BOOL WIN32API SetDlgItemTextW( HWND arg1, int arg2, LPCWSTR  arg3)
    1858 {
    1859 char *astring = UnicodeToAsciiString((LPWSTR)arg3);
    1860 BOOL  rc;
    1861 
    1862 #ifdef DEBUG
    1863     WriteLog("USER32:  SetDlgItemTextW\n");
    1864 #endif
    1865     // NOTE: This will not work as is (needs UNICODE support)
    1866     rc = O32_SetDlgItemText(arg1, arg2, astring);
    1867     FreeAsciiString(astring);
    1868     return rc;
    1869 }
    1870 //******************************************************************************
    1871 //******************************************************************************
    18721437BOOL WIN32API SetDoubleClickTime( UINT arg1)
    18731438{
     
    18761441#endif
    18771442    return O32_SetDoubleClickTime(arg1);
    1878 }
    1879 //******************************************************************************
    1880 //******************************************************************************
    1881 BOOL WIN32API SetPropA( HWND arg1, LPCSTR arg2, HANDLE  arg3)
    1882 {
    1883 #ifdef DEBUG
    1884     if((int)arg2 >> 16 != 0)
    1885      WriteLog("USER32:  SetPropA %S\n", arg2);
    1886     else WriteLog("USER32:  SetPropA %X\n", arg2);
    1887 #endif
    1888     return O32_SetProp(arg1, arg2, arg3);
    1889 }
    1890 //******************************************************************************
    1891 //******************************************************************************
    1892 BOOL WIN32API SetPropW(HWND arg1, LPCWSTR arg2, HANDLE arg3)
    1893 {
    1894  BOOL  rc;
    1895  char *astring;
    1896 
    1897     if((int)arg2 >> 16 != 0)
    1898          astring = UnicodeToAsciiString((LPWSTR)arg2);
    1899     else astring = (char *)arg2;
    1900 
    1901 #ifdef DEBUG
    1902     if((int)arg2 >> 16 != 0)
    1903          WriteLog("USER32:  SetPropW %S\n", astring);
    1904     else WriteLog("USER32:  SetPropW %X\n", astring);
    1905 #endif
    1906     rc = O32_SetProp(arg1, astring, arg3);
    1907     if((int)astring >> 16 != 0)
    1908         FreeAsciiString(astring);
    1909     return(rc);
    19101443}
    19111444//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.