Examples of TCHAR


Examples of org.eclipse.swt.internal.win32.TCHAR

    if (itemMap.containsKey(item.getId()))
      return;
    int uFlags = Win32.MF_BYCOMMAND;
    if (style == Win32.MF_BYPOSITION)
      uFlags = Win32.MF_BYPOSITION;
    TCHAR lpNewItem = null;
    if ((item.getStyle() & SWT.SEPARATOR) != 0) {
      uFlags |= Win32.MF_SEPARATOR;
    } else {
      uFlags |= Win32.MF_STRING;
      lpNewItem = new TCHAR(0, item.getText(), true);
    }
    Extension2.InsertMenu(hMenu, position, uFlags, item.getId().intValue(),
        lpNewItem);
    if ((item.getStyle() & SWT.SEPARATOR) == 0) {
      item.setEnabled(item.isEnabled());
View Full Code Here

Examples of org.eclipse.swt.internal.win32.TCHAR

      if (pszText != 0)
        OS.HeapFree(hHeap, 0, pszText);
      SWT.error(SWT.ERROR_CANNOT_GET_TEXT);
    }
    pszText = info.dwTypeData;
    TCHAR buffer = new TCHAR(0, info.cch / TCHAR.sizeof);
    OS.MoveMemory(buffer, pszText, info.cch);
    if (pszText != 0)
      OS.HeapFree(hHeap, 0, pszText);
    return buffer.toString(0, buffer.strlen());
  }
View Full Code Here

Examples of org.eclipse.swt.internal.win32.TCHAR

    boolean success = false;

    MENUITEMINFO info = new MENUITEMINFO();
    info.cbSize = MENUITEMINFO.sizeof;
    /* Use the character encoding for the default locale */
    TCHAR buffer = new TCHAR(0, text, true);
    int byteCount = buffer.length() * TCHAR.sizeof;
    pszText = Extension.HeapAlloc(hHeap, Extension.HEAP_ZERO_MEMORY,
        byteCount);
    OS.MoveMemory(pszText, buffer, byteCount);
    /*
     * Bug in Windows 2000. For some reason, when MIIM_TYPE is set on a menu
View Full Code Here

Examples of org.eclipse.swt.internal.win32.TCHAR

    else
      lpFileOp = new SHFILEOPSTRUCTA();
    lpFileOp.wFunc = 3;
    String fileName = file.getAbsolutePath();
    int hHeap = Extension.GetProcessHeap();
    TCHAR buffer = new TCHAR(0, fileName, true);
    int byteCount = buffer.length() * TCHAR.sizeof;
    int lpFileName = Extension.HeapAlloc(hHeap, Extension.HEAP_ZERO_MEMORY, byteCount);
    Extension.MoveMemory(lpFileName, buffer, byteCount);
    lpFileOp.pFrom = lpFileName;
    if (confirm) lpFileOp.fFlags = Win32.FOF_ALLOWUNDO;
    else
View Full Code Here

Examples of org.eclipse.swt.internal.win32.TCHAR

   *            the name of library to be loaded.
   */
  public void loadVersionInfo(String libraryName) {
    DLLVERSIONINFO dvi = new DLLVERSIONINFO();
    dvi.cbSize = DLLVERSIONINFO.sizeof;
    TCHAR lpLibFileName = new TCHAR(0, libraryName, true); //$NON-NLS-1$
    int hModule = OS.LoadLibrary(lpLibFileName);
    if (hModule != 0) {
      String name = "DllGetVersion\0"; //$NON-NLS-1$
      byte[] lpProcName = new byte[name.length()];
      for (int i = 0; i < lpProcName.length; i++) {
View Full Code Here

Examples of org.eclipse.swt.internal.win32.TCHAR

   *            is a file name to extract the icon from.
   * @param style
   *            icon style, one of {@link #ICON_SMALL}or {@link #ICON_LARGE}.
   */
  public static Image[] getFileIcons(File file, int style) {
    TCHAR lpszFile = new TCHAR(0, file.getAbsolutePath(), true);
    int totleIcon = Extension.ExtractIconEx(lpszFile, -1, null, null, 0);
    if (totleIcon < 1)
      return new Image[0];
    else {
      List imageList = new LinkedList();
View Full Code Here

Examples of org.eclipse.swt.internal.win32.TCHAR

   *            a zero-based index of the icon to retrieve.
   * @param style
   *            icon style,  {@link #ICON_SMALL} or {@link #ICON_LARGE}.
   */
  public static Image[] getFileIcons(File file, int index, int style) {
    TCHAR lpszFile = new TCHAR(0, file.getAbsolutePath(), true);
    int totleIcon = Extension.ExtractIconEx(lpszFile, -1, null, null, 0);
    if (totleIcon < 1 || index < -1 || index >= totleIcon)
      return new Image[0];
    else {
      List imageList = new LinkedList();
View Full Code Here

Examples of org.eclipse.swt.internal.win32.TCHAR

   *         successful, the id doesn't equals 0.
   */
  public static int getDeviceID(String path)
  {
    MCI_OPEN_PARMS parms = null;
    TCHAR strDeviceType = new TCHAR(0, MCI_DEVTYPE_CD_AUDIO, true);
    TCHAR strElementName = new TCHAR(0, path, true);
    int hHeap = Extension.GetProcessHeap();
    int byteCount = strDeviceType.length() * TCHAR.sizeof;
    int lpstrDeviceType = Extension
        .HeapAlloc(hHeap, Extension.HEAP_ZERO_MEMORY, byteCount);
    Extension.MoveMemory(lpstrDeviceType, strDeviceType, byteCount);

    byteCount = strElementName.length() * TCHAR.sizeof;
    int lpstrElementName = Extension.HeapAlloc(hHeap, Extension.HEAP_ZERO_MEMORY,
        byteCount);
    Extension.MoveMemory(lpstrElementName, strElementName, byteCount);

    if (Extension.IsUnicode)
View Full Code Here

Examples of org.eclipse.swt.internal.win32.TCHAR

   *            specified window's className.
   * @return specified window handle.
   */
  public static int findWindow(String className)
  {
    return Extension.FindWindow(new TCHAR(0, className, true), null);
  }
View Full Code Here

Examples of org.eclipse.swt.internal.win32.TCHAR

   * @param windowName
   * @return handle of the found window if succeeds.
   */
  public static int findWindow(String className, String windowName)
  {
    TCHAR CLASSNAME = null;
    TCHAR WINDOWNAME = null;
    if (className != null) CLASSNAME = new TCHAR(0, className, true);
    if (windowName != null) WINDOWNAME = new TCHAR(0, windowName, true);
    return Extension.FindWindow(CLASSNAME, WINDOWNAME);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.