home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / sdk20 / jsdk05.cab / Src / Win32Api / Comdlg32.java < prev    next >
Encoding:
Java Source  |  1997-09-25  |  2.5 KB  |  77 lines

  1. // Copyright (C) 1997 Microsoft Corporation  All Rights Reserved
  2.  
  3. // These classes provide direct, low-overhead access to commonly used
  4. // Windows api. These classes use the new J/Direct feature.
  5. //
  6. // Information on how to use J/Direct to write your own declarations
  7. // can be found in the Microsoft SDK for Java 2.0.
  8.  
  9. package com.ms.win32;
  10.  
  11. /** @security(checkClassLinking=on) */
  12. public class Comdlg32 {
  13.     /** @dll.import("COMDLG32", auto) */
  14.     public native static boolean ChooseColor (CHOOSECOLOR anon0);
  15.  
  16.     /** @dll.import("COMDLG32",entrypoint="ChooseFont", auto) */
  17.     private native static boolean ChooseFont_I (CHOOSEFONT anon0);
  18.  
  19.         public static boolean ChooseFont(CHOOSEFONT cf)
  20.         {
  21.             cf.lpszStyle = (cf.lpszStyle == null ? "" : cf.lpszStyle) + new String(new char[300]);
  22.             return ChooseFont_I(cf);
  23.         }
  24.  
  25.     /** @dll.import("COMDLG32", auto) */
  26.     public native static int CommDlgExtendedError ();
  27.  
  28.     /** @dll.import("COMDLG32", auto) */
  29.     public native static int FindText (FINDREPLACE anon0);
  30.  
  31.     /** @dll.import("COMDLG32", auto) */
  32.     public native static short GetFileTitle (String anon0, StringBuffer anon1, short anon2);
  33.  
  34.     /** @dll.import("COMDLG32", auto, entrypoint="GetOpenFileName") */
  35.     private native static boolean GetOpenFileName_I (OPENFILENAME anon0);
  36.  
  37.         public static boolean GetOpenFileName (OPENFILENAME ofn)
  38.         {
  39.             ofn.lpstrFile = (ofn.lpstrFile == null ? "" : ofn.lpstrFile) +
  40.                             new String(new char[ofn.nMaxFile]);
  41.  
  42.  
  43.             ofn.lpstrFileTitle = new String(new char[ofn.nMaxFileTitle]);
  44.  
  45.  
  46.             boolean result = GetOpenFileName_I(ofn);
  47.             return result;
  48.         }
  49.  
  50.  
  51.     /** @dll.import("COMDLG32", auto, entrypoint="GetSaveFileName") */
  52.     private native static boolean GetSaveFileName_I (OPENFILENAME anon0);
  53.  
  54.         public static boolean GetSaveFileName (OPENFILENAME ofn)
  55.         {
  56.             ofn.lpstrFile = (ofn.lpstrFile == null ? "" : ofn.lpstrFile) +
  57.                             new String(new char[ofn.nMaxFile]);
  58.  
  59.  
  60.             ofn.lpstrFileTitle = new String(new char[ofn.nMaxFileTitle]);
  61.  
  62.  
  63.             boolean result = GetSaveFileName_I(ofn);
  64.             return result;
  65.         }
  66.  
  67.     /** @dll.import("COMDLG32", auto) */
  68.     public native static boolean PageSetupDlg (PAGESETUPDLG anon0);
  69.  
  70.     /** @dll.import("COMDLG32", auto) */
  71.     public native static boolean PrintDlg (PRINTDLG anon0);
  72.  
  73.     /** @dll.import("COMDLG32", auto) */
  74.     public native static int ReplaceText (FINDREPLACE anon0);
  75. }
  76.  
  77.