1

Konu: Font Belirleme

Set Textmerge delimiters to '%%','%%'
Set Textmerge on
Set Textmerge to kontrol.txt noshow
   
\%%"Satır1"%%
\%%"Satır2"%%
\%%"Satır3"%%
\%%"RAPOR TARİHİ: "%%
\\%%Date()%%

Set Textmerge to
Set Textmerge off

declare long ShellExecute in "shell32.dll" ;
long hwnd, string lpszOp, ;
string lpszFile, string lpszParams, ;
string lpszDir, long nShowCmd
ShellExecute(0,'open','kontrol.txt',0,0,3)


Yukarıdaki kodla oluşturduğum kontrol.txt dosyasını not defteri ile açıyorum. Ancak Yazı stilini her açılışta courier new tur, 10 yapmak istiyorum. Yani not defterinin önceki yazı stili ne olursa olsun font benim belirlediğim font olsun istiyorum.

2

Re: Font Belirleme

Senin kodun devami:

Visual Fox Pro
declare long ShellExecute in "shell32.dll" ;

long hwnd, string lpszOp, ;
string lpszFile, string lpszParams, ;
string lpszDir, long nShowCmd
ShellExecute(0,'open','kontrol.txt',0,0,3)
 
Declare Sleep in win32API integer
DECLARE integer FindWindow in WIN32API string cClassName, string cWinName
Declare INTEGER GetWindowText IN Win32API ;
  INTEGER hwnd, STRING @lptstr, INTEGER cbmax
DO WHILE !IsWindowUp("notepad","kontrol.txt")
Sleep(100)
ENDDO
 
WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate("Notepad")
WshShell.SendKeys ("%of")
WshShell.SendKeys("Courier")
WshShell.SendKeys("~")
 
FUNCTION IsWindowUp(tcClassName,tcCaption)
LOCAL cTitle, hWnd
cTitle = replicate(chr(0),200)
hWnd = FindWindow(m.tcClassName,0)
RETURN m.hWnd > 0 AND ;
    GetWindowText(hwnd, @ctitle, 200) > 0 AND ;
    ATC(m.tcCaption,cTitle) = 1

3

Re: Font Belirleme

WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate("Notepad")
WshShell.SendKeys ("%of")
WshShell.SendKeys("Courier")
WshShell.SendKeys("~")

Blogu Turkce notepad kullananlar icin:

Visual Fox Pro
WshShell = CreateObject("WScript.Shell")

WshShell.AppActivate("Notepad")
WshShell.SendKeys ("%by")
WshShell.SendKeys("Courier")
WshShell.SendKeys("~")