Como abrir notepad maximizado
Enviado: 02 Mar 2017 08:57
Bowa, aSimoes!
Vou dar uma olhada nesse fonte hehehe
Janio
Vou dar uma olhada nesse fonte hehehe
Janio
Em xHabour, não sei. Mas tente compilar isto:Porter escreveu:olá pessoal, com esse comando estou abrindo o notepad, gostaria de saber se existe alguma lib
que eu possa usar para abri-lo maximizado com xHarbour
Código: Selecionar todos
Function Main()
hb_MemoWrit("Relat.txt","Teste de relatorio"+Chr(13)+Chr(10)+"2ª linha")
HINSTANCE := FileExecute( 0, Nil, "Notepad.exe", "Relat.txt", Nil, 3 /* SW_MAXIMIZE */ )
If HINSTANCE > 32
// Ok
Else
/* System Error Codes: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx
0 = The operating system is out of memory or resources.
ERROR_FILE_NOT_FOUND = The specified file was not found.
ERROR_PATH_NOT_FOUND = The specified path was not found.
ERROR_BAD_FORMAT = The .exe file is invalid (non-Win32 .exe or error in .exe image).
SE_ERR_ACCESSDENIED = The operating system denied access to the specified file.
SE_ERR_ASSOCINCOMPLETE = The file name association is incomplete or invalid.
SE_ERR_DDEBUSY = The DDE transaction could not be completed because other DDE transactions were being processed.
SE_ERR_DDEFAIL = The DDE transaction failed.
SE_ERR_DDETIMEOUT = The DDE transaction could not be completed because the request timed out.
SE_ERR_DLLNOTFOUND = The specified DLL was not found.
SE_ERR_FNF = The specified file was not found.
SE_ERR_NOASSOC = There is no application associated with the given file name extension. This error will also be returned if you attempt to print a file that is not printable.
SE_ERR_OOM = There was not enough memory to complete the operation.
SE_ERR_PNF = The specified path was not found.
SE_ERR_SHARE = A sharing violation occurred. */
Endif
Return Nil
#pragma BEGINDUMP
#include <windows.h>
#include "hbapi.h"
// ShellExecute ( [hWnd], [cOperation], cFile, [cParameters], [cDirectory], nShowCmd ) --> return hInstance or nError
HB_FUNC( FILEEXECUTE )
{
CoInitializeEx (NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
HINSTANCE hInstance = ShellExecute( (HWND) hb_parnl(1), HB_ISNIL(2) ? NULL : (LPCTSTR) hb_parc(2),(LPCTSTR) hb_parc(3),HB_ISNIL(4) ? NULL : (LPCTSTR) hb_parc(4),HB_ISNIL(5) ? NULL : (LPCTSTR) hb_parc(5),hb_parni(6) );
hb_retnl ((LONG_PTR) hInstance );
}
#pragma ENDDUMPCódigo: Selecionar todos
@echo off
set path=C:\hb32\bin;C:\hb32\comp\mingw\bin;%path%
set HB_COMPILER=mingw
cd\
%SystemRoot%\system32\cmd.exeCódigo: Selecionar todos
CLS
HBMK2 ESTOQUE.HBP
Código: Selecionar todos
#Include "FiveWin.ch"
* MODO DA WINDOW *
#define SW_MAXIMIZE 3
Function Main()
LOCAL cFile := "Relat.txt"
hb_MemoWrit( "Relat.txt", "Teste de relatorio" +Chr(13)+Chr(10)+"2ª linha" )
WinExec( "Notepad.exe " + cFile, 3 ) // 3 = SW_MAXIMIZE
Return Nil
Código: Selecionar todos
PROCEDURE W32PRN(arqtxt)
#include "WinGdi.ch" <--- Erro de compilação nessa linha
Local cPrinter
Local contl := 1
cFileName := "C:\ESTOQUE\" + arqtxt
SET PRINTER TO
SET DEVICE TO SCREEN
If !File("&cFileName")
Return Nil
Else
cLinha := Nil
aLinesPrint := {}
cBuffer := FOpen( cFileName, 2 )
Do While Hb_FReadLine( cBuffer, @cLinha, Nil, 255 ) = 0
AaDd( aLinesPrint, cLinha )
EndDo
FClose( cBuffer )
EndIf