Tk Source Code

Check-in [201af9ec]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[BUG 3163893] -initialdir option bug for tk_chooseDirectory under XP
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 201af9ecc634509b51ab4736736263c5ffcbab79
User & Date: jan.nijtmans 2011-10-10 11:31:26
Context
2011-10-10
11:51
correct -DUNICODE handling for tk_chooseColor dialog check-in: 360b1600 user: jan.nijtmans tags: trunk
11:31
[BUG 3163893] -initialdir option bug for tk_chooseDirectory under XP check-in: 201af9ec user: jan.nijtmans tags: trunk
2011-10-05
14:04
wrong copy/paste in ChangeLog check-in: 7131b4c5 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.






1
2
3
4
5
6
7
8
9
10





2011-10-05  Jan Nijtmans  <[email protected]>

	* win/tkWinInt.h:   Remove tclWinProcs, as it is no longer
	* win/tkWinX.c:     being used.
	* win/tkWinTest.c:

2011-09-27  Donal K. Fellows  <[email protected]>

	* generic/tkImgPNG.c (WriteExtraChunks): [Bug 3405839]: Write the sDAT
	chunk with the correct length.
>
>
>
>
>


|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2011-10-10  Jan Nijtmans  <[email protected]>

	* win/tkWinDialog.c: [BUG 3163893] -initialdir option bug for
	tk_chooseDirectory under XP

2011-10-05  Jan Nijtmans  <[email protected]>

	* win/tkWinInt.h:   Remove tkWinProcs, as it is no longer
	* win/tkWinX.c:     being used.
	* win/tkWinTest.c:

2011-09-27  Donal K. Fellows  <[email protected]>

	* generic/tkImgPNG.c (WriteExtraChunks): [Bug 3405839]: Write the sDAT
	chunk with the correct length.

Changes to win/tkWinDialog.c.

1645
1646
1647
1648
1649
1650
1651


1652

1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685

1686
1687
1688
1689
1690
1691
1692
	/*
	 * Directory browser intializing - tell it where to start from, user
	 * specified parameter.
	 */

	char *initDir = chooseDirSharedData->utfInitDir;



	SetCurrentDirectoryA(initDir);

	if (*initDir == '\\') {
	    /*
	     * BFFM_SETSELECTION only understands UNC paths as pidls, so
	     * convert path to pidl using IShellFolder interface.
	     */

	    LPMALLOC pMalloc;
	    LPSHELLFOLDER psfFolder;

	    if (SUCCEEDED(SHGetMalloc(&pMalloc))) {
		if (SUCCEEDED(SHGetDesktopFolder(&psfFolder))) {
		    LPITEMIDLIST pidlMain;
		    ULONG ulCount, ulAttr;
		    Tcl_DString ds;

		    Tcl_UtfToExternalDString(TkWinGetUnicodeEncoding(),
			    initDir, -1, &ds);
		    if (SUCCEEDED(psfFolder->lpVtbl->ParseDisplayName(
			    psfFolder, hwnd, NULL, (WCHAR *)
			    Tcl_DStringValue(&ds), &ulCount,&pidlMain,&ulAttr))
			    && (pidlMain != NULL)) {
			SendMessageA(hwnd, BFFM_SETSELECTION, FALSE,
				(LPARAM) pidlMain);
			pMalloc->lpVtbl->Free(pMalloc, pidlMain);
		    }
		    psfFolder->lpVtbl->Release(psfFolder);
		    Tcl_DStringFree(&ds);
		}
		pMalloc->lpVtbl->Release(pMalloc);
	    }
	} else {
	    SendMessageA(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM) initDir);
	}

	SendMessageA(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1);
	break;
    }

    }
    return 0;
}







>
>
|
>













<

<
<


|






<




|

>







1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668

1669


1670
1671
1672
1673
1674
1675
1676
1677
1678

1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
	/*
	 * Directory browser intializing - tell it where to start from, user
	 * specified parameter.
	 */

	char *initDir = chooseDirSharedData->utfInitDir;

	Tcl_DString initDirDStr;
	Tcl_UtfToExternalDString(TkWinGetUnicodeEncoding(), initDir, -1, &initDirDStr);
	SetCurrentDirectoryA(Tcl_DStringValue(&initDirDStr));
	
	if (*initDir == '\\') {
	    /*
	     * BFFM_SETSELECTION only understands UNC paths as pidls, so
	     * convert path to pidl using IShellFolder interface.
	     */

	    LPMALLOC pMalloc;
	    LPSHELLFOLDER psfFolder;

	    if (SUCCEEDED(SHGetMalloc(&pMalloc))) {
		if (SUCCEEDED(SHGetDesktopFolder(&psfFolder))) {
		    LPITEMIDLIST pidlMain;
		    ULONG ulCount, ulAttr;




		    if (SUCCEEDED(psfFolder->lpVtbl->ParseDisplayName(
			    psfFolder, hwnd, NULL, (WCHAR *)
			    Tcl_DStringValue(&initDirDStr), &ulCount,&pidlMain,&ulAttr))
			    && (pidlMain != NULL)) {
			SendMessageA(hwnd, BFFM_SETSELECTION, FALSE,
				(LPARAM) pidlMain);
			pMalloc->lpVtbl->Free(pMalloc, pidlMain);
		    }
		    psfFolder->lpVtbl->Release(psfFolder);

		}
		pMalloc->lpVtbl->Release(pMalloc);
	    }
	} else {
	    SendMessageA(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM) Tcl_DStringValue(&initDirDStr));
	}
	Tcl_DStringFree(&initDirDStr);
	SendMessageA(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1);
	break;
    }

    }
    return 0;
}