diff --git a/dlls/comctl32/pager.c b/dlls/comctl32/pager.c index 1581dc8fccb..cdf5e7f0adb 100644 --- a/dlls/comctl32/pager.c +++ b/dlls/comctl32/pager.c @@ -1114,7 +1114,11 @@ PAGER_HitTest (HWND hwnd, LPPOINT pt) static LRESULT PAGER_NCHitTest (HWND hwnd, WPARAM wParam, LPARAM lParam) { - POINT pt = { SLOWORD(lParam), SHIWORD(lParam) }; + POINT pt; + + pt.x = SLOWORD(lParam); + pt.y = SHIWORD(lParam); + ScreenToClient (hwnd, &pt); return PAGER_HitTest(hwnd, &pt); } @@ -1184,7 +1188,7 @@ static LRESULT PAGER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) { PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); - POINT clpt, pt = {SLOWORD(lParam), SHIWORD(lParam)}; + POINT clpt, pt; RECT wnrect, TLbtnrect, BRbtnrect, *btnrect = NULL; DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE); BOOL topLeft = FALSE; @@ -1192,6 +1196,9 @@ PAGER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) INT hit; HDC hdc; + pt.x = SLOWORD(lParam); + pt.y = SHIWORD(lParam); + TRACE("[%08x] to (%ld,%ld)\n", hwnd, pt.x, pt.y); ClientToScreen(hwnd, &pt); GetWindowRect(hwnd, &wnrect); @@ -1272,9 +1279,12 @@ PAGER_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) { PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); BOOL repaintBtns = FALSE; - POINT pt = { SLOWORD(lParam), SHIWORD(lParam) }; + POINT pt; INT hit; + pt.x = SLOWORD(lParam); + pt.y = SHIWORD(lParam); + TRACE("[%08x] at (%d,%d)\n", hwnd, SLOWORD(lParam), SHIWORD(lParam)); hit = PAGER_HitTest(hwnd, &pt); @@ -1339,7 +1349,10 @@ PAGER_LButtonUp (HWND hwnd, WPARAM wParam, LPARAM lParam) static LRESULT PAGER_NCLButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) { - POINT pt = {SLOWORD(lParam), SHIWORD(lParam)}; + POINT pt; + + pt.x = SLOWORD(lParam); + pt.y = SHIWORD(lParam); TRACE("[%08x] at (%d,%d)\n", hwnd, SLOWORD(lParam), SHIWORD(lParam)); MapWindowPoints(0, hwnd, &pt, 1); @@ -1592,4 +1605,3 @@ PAGER_Unregister (void) { UnregisterClassA (WC_PAGESCROLLERA, (HINSTANCE)NULL); } - diff --git a/dlls/commdlg/filedlg95.c b/dlls/commdlg/filedlg95.c index 566d98155c8..533474e6b04 100644 --- a/dlls/commdlg/filedlg95.c +++ b/dlls/commdlg/filedlg95.c @@ -983,16 +983,15 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) {VIEW_LIST, FCIDM_TB_SMALLICON, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, {VIEW_DETAILS, FCIDM_TB_REPORTVIEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, }; - TBADDBITMAP tba[] = - { - { HINST_COMMCTRL, IDB_VIEW_SMALL_COLOR }, - { COMDLG32_hInstance, 800 } /* desktop icon */ - }; - + TBADDBITMAP tba[2]; RECT rectTB; - FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); + tba[0].hInst = HINST_COMMCTRL; + tba[0].nID = IDB_VIEW_SMALL_COLOR; + tba[1].hInst = COMDLG32_hInstance; + tba[1].nID = 800; + TRACE("%p\n", fodInfos); /* Get windows version emulating */ diff --git a/dlls/ddraw/ddraw/thunks.c b/dlls/ddraw/ddraw/thunks.c index 396824d044c..10296fa238a 100644 --- a/dlls/ddraw/ddraw/thunks.c +++ b/dlls/ddraw/ddraw/thunks.c @@ -336,7 +336,10 @@ IDirectDrawImpl_EnumDisplayModes(LPDIRECTDRAW This, DWORD dwFlags, LPDDSURFACEDESC pDDSD, LPVOID context, LPDDENUMMODESCALLBACK cb) { - struct displaymodescallback_context cbcontext = { cb, context }; + struct displaymodescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl, IDirectDraw, @@ -351,7 +354,10 @@ IDirectDraw2Impl_EnumDisplayModes(LPDIRECTDRAW2 This, DWORD dwFlags, LPDDSURFACEDESC pDDSD, LPVOID context, LPDDENUMMODESCALLBACK cb) { - struct displaymodescallback_context cbcontext = { cb, context }; + struct displaymodescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl, IDirectDraw2, @@ -399,7 +405,11 @@ IDirectDrawImpl_EnumSurfaces(LPDIRECTDRAW This, DWORD dwFlags, LPDDSURFACEDESC pDDSD, LPVOID context, LPDDENUMSURFACESCALLBACK cb) { - struct surfacescallback_context cbcontext = { cb, context }; + struct surfacescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; + return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl, IDirectDraw, IDirectDraw7, This), @@ -412,7 +422,11 @@ IDirectDraw2Impl_EnumSurfaces(LPDIRECTDRAW2 This, DWORD dwFlags, LPDDSURFACEDESC pDDSD, LPVOID context, LPDDENUMSURFACESCALLBACK cb) { - struct surfacescallback_context cbcontext = { cb, context }; + struct surfacescallback_context cbcontext; + + cbcontext.func = cb; + cbcontext.context = context; + return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl, IDirectDraw2, IDirectDraw7, This), diff --git a/dlls/ddraw/dsurface/thunks.c b/dlls/ddraw/dsurface/thunks.c index d6a9a546f15..a5cc2637a5d 100644 --- a/dlls/ddraw/dsurface/thunks.c +++ b/dlls/ddraw/dsurface/thunks.c @@ -135,7 +135,11 @@ IDirectDrawSurface3Impl_EnumAttachedSurfaces(LPDIRECTDRAWSURFACE3 This, LPVOID context, LPDDENUMSURFACESCALLBACK callback) { - struct callback_info info = { callback, context }; + struct callback_info info; + + info.callback = callback; + info.context = context; + return IDirectDrawSurface7_EnumAttachedSurfaces(CONVERT(This), &info, EnumCallback); } @@ -145,7 +149,11 @@ IDirectDrawSurface3Impl_EnumOverlayZOrders(LPDIRECTDRAWSURFACE3 This, DWORD dwFlags, LPVOID context, LPDDENUMSURFACESCALLBACK callback) { - struct callback_info info = { callback, context }; + struct callback_info info; + + info.callback = callback; + info.context = context; + return IDirectDrawSurface7_EnumOverlayZOrders(CONVERT(This), dwFlags, &info, EnumCallback); } @@ -163,10 +171,15 @@ IDirectDrawSurface3Impl_GetAttachedSurface(LPDIRECTDRAWSURFACE3 This, LPDDSCAPS pCaps, LPDIRECTDRAWSURFACE3* ppAttached) { - DDSCAPS2 caps = { pCaps->dwCaps, 0, 0, 0 }; + DDSCAPS2 caps; LPDIRECTDRAWSURFACE7 pAttached7; HRESULT hr; + caps.dwCaps = pCaps->dwCaps; + caps.dwCaps2 = 0; + caps.dwCaps3 = 0; + caps.dwCaps4 = 0; + hr = IDirectDrawSurface7_GetAttachedSurface(CONVERT(This), &caps, &pAttached7); if (FAILED(hr)) return hr; diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c index 4e8518e1f1d..fb8596d68fb 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c @@ -133,7 +133,7 @@ static PROXYHANDLE gProxyHandle = { FALSE, FALSE, ERROR_LIBRARY_NOT_FOUND, - { }, + { 0, 0, 0, 0 }, "", "", "", diff --git a/dlls/winsock/socket.c b/dlls/winsock/socket.c index 1145622aca9..db1b95fa0dc 100644 --- a/dlls/winsock/socket.c +++ b/dlls/winsock/socket.c @@ -2329,7 +2329,10 @@ INT16 WINAPI WINSOCK_listen16(SOCKET16 s, INT16 backlog) int WINAPI WS_recv(SOCKET s, char *buf, int len, int flags) { DWORD n, dwFlags = flags; - WSABUF wsabuf = { len, buf }; + WSABUF wsabuf; + + wsabuf.len = len; + wsabuf.buf = buf; if ( WSARecvFrom (s, &wsabuf, 1, &n, &dwFlags, NULL, NULL, NULL, NULL) == SOCKET_ERROR ) return SOCKET_ERROR; @@ -2353,7 +2356,10 @@ int WINAPI WS_recvfrom(SOCKET s, char *buf, INT len, int flags, struct WS_sockaddr *from, int *fromlen) { DWORD n, dwFlags = flags; - WSABUF wsabuf = { len, buf }; + WSABUF wsabuf; + + wsabuf.len = len; + wsabuf.buf = buf; if ( WSARecvFrom (s, &wsabuf, 1, &n, &dwFlags, from, fromlen, NULL, NULL) == SOCKET_ERROR ) return SOCKET_ERROR; @@ -2476,7 +2482,10 @@ int WINAPI WS_select(int nfds, WS_fd_set *ws_readfds, int WINAPI WS_send(SOCKET s, const char *buf, int len, int flags) { DWORD n; - WSABUF wsabuf = { len, (char*) buf }; + WSABUF wsabuf; + + wsabuf.len = len; + wsabuf.buf = (char*) buf; if ( WSASendTo ( s, &wsabuf, 1, &n, flags, NULL, 0, NULL, NULL) == SOCKET_ERROR ) return SOCKET_ERROR; @@ -2622,7 +2631,10 @@ int WINAPI WS_sendto(SOCKET s, const char *buf, int len, int flags, const struct WS_sockaddr *to, int tolen) { DWORD n; - WSABUF wsabuf = { len, (char*) buf }; + WSABUF wsabuf; + + wsabuf.len = len; + wsabuf.buf = (char*) buf; if ( WSASendTo (s, &wsabuf, 1, &n, flags, to, tolen, NULL, NULL) == SOCKET_ERROR ) return SOCKET_ERROR; diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c index 1a2f80a4b94..50131cd6977 100644 --- a/programs/winefile/winefile.c +++ b/programs/winefile/winefile.c @@ -809,7 +809,12 @@ static void resize_frame_rect(HWND hwnd, PRECT prect) static void resize_frame(HWND hwnd, int cx, int cy) { - RECT rect = {0, 0, cx, cy}; + RECT rect; + + rect.left = 0; + rect.top = 0; + rect.right = cx; + rect.bottom = cy; resize_frame_rect(hwnd, &rect); } @@ -842,15 +847,19 @@ LRESULT CALLBACK CBTProc(int code, WPARAM wparam, LPARAM lparam) static HWND create_child_window(ChildWnd* child) { - MDICREATESTRUCT mcs = { - WINEFILETREE, (LPTSTR)child->path, Globals.hInstance, - child->pos.rcNormalPosition.left, child->pos.rcNormalPosition.top, - child->pos.rcNormalPosition.right-child->pos.rcNormalPosition.left, - child->pos.rcNormalPosition.bottom-child->pos.rcNormalPosition.top, - 0/*style*/, 0/*lParam*/ - }; + MDICREATESTRUCT mcs; int idx; + mcs.szClass = WINEFILETREE; + mcs.szTitle = (LPTSTR)child->path; + mcs.hOwner = Globals.hInstance; + mcs.x = child->pos.rcNormalPosition.left; + mcs.y = child->pos.rcNormalPosition.top; + mcs.cx = child->pos.rcNormalPosition.right-child->pos.rcNormalPosition.left; + mcs.cy = child->pos.rcNormalPosition.bottom-child->pos.rcNormalPosition.top; + mcs.style = 0; + mcs.lParam = 0; + hcbthook = SetWindowsHookEx(WH_CBT, CBTProc, 0, GetCurrentThreadId()); newchild = child; @@ -1247,14 +1256,22 @@ const static int g_pos_align[] = { static void resize_tree(ChildWnd* child, int cx, int cy) { HDWP hdwp = BeginDeferWindowPos(4); - RECT rt = {0, 0, cx, cy}; + RECT rt; + + rt.left = 0; + rt.top = 0; + rt.right = cx; + rt.bottom = cy; cx = child->split_pos + SPLIT_WIDTH/2; #ifndef _NO_EXTENSIONS { WINDOWPOS wp; - HD_LAYOUT hdl = {&rt, &wp}; + HD_LAYOUT hdl; + + hdl.prc = &rt; + hdl.pwpos = ℘ Header_Layout(child->left.hwndHeader, &hdl); @@ -1345,9 +1362,15 @@ static BOOL calc_widths(Pane* pane, BOOL anyway) for(cnt=0; cnthwnd, cnt); - DRAWITEMSTRUCT dis = {0/*CtlType*/, 0/*CtlID*/, - 0/*itemID*/, 0/*itemAction*/, 0/*itemState*/, - pane->hwnd/*hwndItem*/, hdc}; + DRAWITEMSTRUCT dis; + + dis.CtlType = 0; + dis.CtlID = 0; + dis.itemID = 0; + dis.itemAction = 0; + dis.itemState = 0; + dis.hwndItem = pane->hwnd; + dis.hDC = hdc; draw_item(pane, &dis, entry, COLUMNS); } @@ -1412,7 +1435,15 @@ static void calc_single_width(Pane* pane, int col) for(cnt=0; cnthwnd, cnt); - DRAWITEMSTRUCT dis = {0, 0, 0, 0, 0, pane->hwnd, hdc}; + DRAWITEMSTRUCT dis; + + dis.CtlType = 0; + dis.CtlID = 0; + dis.itemID = 0; + dis.itemAction = 0; + dis.itemState = 0; + dis.hwndItem = pane->hwnd; + dis.hDC = hdc; draw_item(pane, &dis, entry, col); } @@ -1586,7 +1617,12 @@ static void calc_tabbed_width(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR static void output_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str, DWORD flags) { int x = dis->rcItem.left; - RECT rt = {x+pane->positions[col]+Globals.spaceSize.cx, dis->rcItem.top, x+pane->positions[col+1]-Globals.spaceSize.cx, dis->rcItem.bottom}; + RECT rt; + + rt.left = x+pane->positions[col]+Globals.spaceSize.cx; + rt.top = dis->rcItem.top; + rt.right = x+pane->positions[col+1]-Globals.spaceSize.cx; + rt.bottom = dis->rcItem.bottom; DrawText(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|flags); } @@ -1594,7 +1630,12 @@ static void output_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str, static void output_tabbed_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str) { int x = dis->rcItem.left; - RECT rt = {x+pane->positions[col]+Globals.spaceSize.cx, dis->rcItem.top, x+pane->positions[col+1]-Globals.spaceSize.cx, dis->rcItem.bottom}; + RECT rt; + + rt.left = x+pane->positions[col]+Globals.spaceSize.cx; + rt.top = dis->rcItem.top; + rt.right = x+pane->positions[col+1]-Globals.spaceSize.cx; + rt.bottom = dis->rcItem.bottom; /* DRAWTEXTPARAMS dtp = {sizeof(DRAWTEXTPARAMS), 2}; DrawTextEx(dis->hDC, (LPTSTR)str, -1, &rt, DT_SINGLELINE|DT_NOPREFIX|DT_EXPANDTABS|DT_TABSTOP, &dtp);*/ @@ -1605,12 +1646,17 @@ static void output_tabbed_text(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTST static void output_number(Pane* pane, LPDRAWITEMSTRUCT dis, int col, LPCTSTR str) { int x = dis->rcItem.left; - RECT rt = {x+pane->positions[col]+Globals.spaceSize.cx, dis->rcItem.top, x+pane->positions[col+1]-Globals.spaceSize.cx, dis->rcItem.bottom}; + RECT rt; LPCTSTR s = str; TCHAR b[128]; LPTSTR d = b; int pos; + rt.left = x+pane->positions[col]+Globals.spaceSize.cx; + rt.top = dis->rcItem.top; + rt.right = x+pane->positions[col+1]-Globals.spaceSize.cx; + rt.bottom = dis->rcItem.bottom; + if (*s) *d++ = *s++; @@ -1726,9 +1772,16 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi int x; int y = dis->rcItem.top + IMAGE_HEIGHT/2; Entry* up; - RECT rt_clip = {dis->rcItem.left, dis->rcItem.top, dis->rcItem.left+pane->widths[col], dis->rcItem.bottom}; + RECT rt_clip; HRGN hrgn_org = CreateRectRgn(0, 0, 0, 0); - HRGN hrgn = CreateRectRgnIndirect(&rt_clip); + HRGN hrgn; + + rt_clip.left = dis->rcItem.left; + rt_clip.top = dis->rcItem.top; + rt_clip.right = dis->rcItem.left+pane->widths[col]; + rt_clip.bottom = dis->rcItem.bottom; + + hrgn = CreateRectRgnIndirect(&rt_clip); if (!GetClipRgn(dis->hDC, hrgn_org)) { DeleteObject(hrgn_org); @@ -2100,8 +2153,18 @@ static LRESULT pane_notify(Pane* pane, NMHDR* pnmh) { int scroll_pos = GetScrollPos(pane->hwnd, SB_HORZ); - RECT rt_scr = {pane->positions[idx+1]-scroll_pos, 0, clnt.right, clnt.bottom}; - RECT rt_clip = {pane->positions[idx]-scroll_pos, 0, clnt.right, clnt.bottom}; + RECT rt_scr; + RECT rt_clip; + + rt_scr.left = pane->positions[idx+1]-scroll_pos; + rt_scr.top = 0; + rt_scr.right = clnt.right; + rt_scr.bottom = clnt.bottom; + + rt_clip.left = pane->positions[idx]-scroll_pos; + rt_clip.top = 0; + rt_clip.right = clnt.right; + rt_clip.bottom = clnt.bottom; if (rt_scr.left < 0) rt_scr.left = 0; if (rt_clip.left < 0) rt_clip.left = 0; @@ -2636,49 +2699,14 @@ LRESULT CALLBACK TreeWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam) static void InitInstance(HINSTANCE hinstance) { - WNDCLASSEX wcFrame = { - sizeof(WNDCLASSEX), - 0/*style*/, - FrameWndProc, - 0/*cbClsExtra*/, - 0/*cbWndExtra*/, - hinstance, - LoadIcon(hinstance, MAKEINTRESOURCE(IDI_WINEFILE)), - LoadCursor(0, IDC_ARROW), - 0/*hbrBackground*/, - 0/*lpszMenuName*/, - WINEFILEFRAME, - (HICON)LoadImage(hinstance, MAKEINTRESOURCE(IDI_WINEFILE), IMAGE_ICON, - GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED) - }; - - // register frame window class - ATOM hframeClass = RegisterClassEx(&wcFrame); - - - WNDCLASS wcChild = { - CS_CLASSDC|CS_DBLCLKS|CS_VREDRAW, - ChildWndProc, - 0/*cbClsExtra*/, - 0/*cbWndExtra*/, - hinstance, - 0/*hIcon*/, - LoadCursor(0, IDC_ARROW), - 0/*hbrBackground*/, - 0/*lpszMenuName*/, - WINEFILETREE - }; - - // register tree windows class - WINE_UNUSED ATOM hChildClass = RegisterClass(&wcChild); - - + WNDCLASSEX wcFrame; + ATOM hframeClass; + WNDCLASS wcChild; + WINE_UNUSED ATOM hChildClass; HMENU hMenuFrame = LoadMenu(hinstance, MAKEINTRESOURCE(IDM_WINEFILE)); HMENU hMenuWindow = GetSubMenu(hMenuFrame, GetMenuItemCount(hMenuFrame)-2); - CLIENTCREATESTRUCT ccs = { - hMenuWindow, IDW_FIRST_CHILD - }; + CLIENTCREATESTRUCT ccs; INITCOMMONCONTROLSEX icc = { sizeof(INITCOMMONCONTROLSEX), @@ -2690,6 +2718,46 @@ static void InitInstance(HINSTANCE hinstance) HDC hdc = GetDC(0); + + wcFrame.cbSize = sizeof(WNDCLASSEX); + wcFrame.style = 0; + wcFrame.lpfnWndProc = FrameWndProc; + wcFrame.cbClsExtra = 0; + wcFrame.cbWndExtra = 0; + wcFrame.hInstance = hinstance; + wcFrame.hIcon = LoadIcon(hinstance, + MAKEINTRESOURCE(IDI_WINEFILE)); + wcFrame.hCursor = LoadCursor(0, IDC_ARROW); + wcFrame.hbrBackground = 0; + wcFrame.lpszMenuName = 0; + wcFrame.lpszClassName = WINEFILEFRAME; + wcFrame.hIconSm = (HICON)LoadImage(hinstance, + MAKEINTRESOURCE(IDI_WINEFILE), + IMAGE_ICON, + GetSystemMetrics(SM_CXSMICON), + GetSystemMetrics(SM_CYSMICON), + LR_SHARED); + + /* register frame window class */ + hframeClass = RegisterClassEx(&wcFrame); + + wcChild.style = CS_CLASSDC|CS_DBLCLKS|CS_VREDRAW; + wcChild.lpfnWndProc = ChildWndProc; + wcChild.cbClsExtra = 0; + wcChild.cbWndExtra = 0; + wcChild.hInstance = hinstance; + wcChild.hIcon = 0; + wcChild.hCursor = LoadCursor(0, IDC_ARROW); + wcChild.hbrBackground = 0; + wcChild.lpszMenuName = 0; + wcChild.lpszClassName = WINEFILETREE; + + /* register tree windows class */ + hChildClass = RegisterClass(&wcChild); + + ccs.hWindowMenu = hMenuWindow; + ccs.idFirstChild = IDW_FIRST_CHILD; + Globals.hMenuFrame = hMenuFrame; Globals.hMenuView = GetSubMenu(hMenuFrame, 3); Globals.hMenuOptions = GetSubMenu(hMenuFrame, 4);