Jump to content

blenkhn

Members
  • Posts

    16
  • Joined

  • Last visited

blenkhn's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I am having an extreme hard time trying to get the barcode font to work and it doesn't seem to want to. I have built this part of my code and when using a barcode reader it doesn't decode. I have tried to use the script by andybiochem and while the barcode prints and decodes fine I can't seem to include it in my script. the space I can use on the page is only 1/2 inch by 4 inches. I grabbed the formula from a site, it must be wrong, please help Func PrintBC ($barcode = "3FAFP31352R159850-D22D0468") ;Build and Print Barcode $bc = StringSplit($barcode, "") $count = 0; For $e = 0 TO UBound($bc) - 1 Local $n = $e + 1 Local $val = Asc($bc[$e]) If $val == 128 Then $val = 0 ElseIf $val >= 33 And $val <= 126 Then $val -= 32 ElseIf $val > 126 And $val <> 128 Then $val -= 50 EndIf $count += ($val * $n) Next Local $rem = Mod($count, 103) If $rem == 0 Then $rem = 128 ElseIf $rem >= 1 And $rem <= 94 Then $rem += 32 ElseIf $rem > 94 And $rem <> 0 Then $rem += 50 EndIf $check = chr($rem) $code = chr(136)&$barcode&$check&chr(138); $DESIREDFONTSIZE = 16 $hFont = _WinAPI_CreateFont((($DESIREDFONTSIZE * -20) / $TwipsPerPixelY), 0, 0, 0, $FW_NORMAL, False, False, False, _ $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, $DEFAULT_PITCH, 'Code128bWin') _WinAPI_SelectObject($hPrintDc, $hFont) $OutSize = _WinAPI_GetTextExtentPoint32($hPrintDc, $code) $yTop = $yTop + 70 $Left = (($PageWidth - DllStructGetData($OutSize,"X")) / 2) $result = _WinAPI_TextOut($hPrintDc, $Left, $yTop, $code) _WinAPI_DeleteObject($hFont) ;Print BarCode Meaning $DESIREDFONTSIZE = 12 $hFont = _WinAPI_CreateFont((($DESIREDFONTSIZE * -20) / $TwipsPerPixelY), 0, 0, 0, $FW_NORMAL, False, False, False, _ $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, $DEFAULT_PITCH, 'Arial') _WinAPI_SelectObject($hPrintDc, $hFont) $OutSize = _WinAPI_GetTextExtentPoint32($hPrintDc, $barcode) $yTop = $yTop + 60 $Left = (($PageWidth - DllStructGetData($OutSize,"X")) / 2) $result = _WinAPI_TextOut($hPrintDc, $Left, $yTop, $barcode) _WinAPI_DeleteObject($hFont) $result = _WinAPI_EndPage($hPrintDc) Next EndFunc
  2. I have finally upgraded to the newest version of Autoit and encountered several problems with printwinapi. The first were easy where You just needed to comment out the duplicated functions. However I get Variable used without being declared.: $PixelsPerInchY = _WinAPI_GetDeviceCaps($hPrintDc, $__WINAPCONSTANT_LOGPIXELSY) $PixelsPerInchY = _WinAPI_GetDeviceCaps($hPrintDc, ^ ERROR When I run my program now. What was the constant and where do I put them. I also assume that the $__WINAPCONSTANT_LOGPIXELSX will need to be declared as well.
  3. I have finally upgraded to the newest version of Autoit and encountered several problems with printwinapi. The first were easy where You just needed to comment out the duplicated functions. However I get Variable used without being declared.: $PixelsPerInchY = _WinAPI_GetDeviceCaps($hPrintDc, $__WINAPCONSTANT_LOGPIXELSY) $PixelsPerInchY = _WinAPI_GetDeviceCaps($hPrintDc, ^ ERROR When I run my program now. What was the constant and where do I put them. I also assume that the $__WINAPCONSTANT_LOGPIXELSX will need to be declared as well.
  4. I did search and all I found was people asking if it could be done. I like your solution very simple and concise
  5. I have searched and searched and there doesn't seem to be a method for deleting a column from a 2 dimensional array, Is this possible? Please help.
  6. Thanks very much for your help
  7. The difficulty I am experiencing is I would like to use the enter key to do different functions when the focus is on a specific control. I must admit it works very well until you change the focus from the gui created to a different window like internet explorer. Now the enter key doesn't work at all because it is still being captured by the created gui. Is there a way for the hotkey to be localized to the gui? I have supplied some sample code. CODE#include <GUIConstants.au3> HotKeySet("{Enter}", "captureEnter") Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Form1", 271, 375, 193, 125) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $Input1 = GUICtrlCreateInput("Input1", 48, 24, 121, 21) GUICtrlSetOnEvent(-1, "Input1Change") $Input2 = GUICtrlCreateInput("Input2", 48, 69, 121, 21) GUICtrlSetOnEvent(-1, "Input2Change") $Input3 = GUICtrlCreateInput("Input3", 48, 114, 121, 21) GUICtrlSetOnEvent(-1, "Input3Change") $Input4 = GUICtrlCreateInput("Input4", 48, 158, 121, 21) GUICtrlSetOnEvent(-1, "Input4Change") $Input5 = GUICtrlCreateInput("Input5", 48, 203, 121, 21) GUICtrlSetOnEvent(-1, "Input5Change") $Edit1 = GUICtrlCreateEdit("", 48, 248, 185, 89) GUICtrlSetData(-1, "Edit1") GUICtrlSetOnEvent(-1, "Edit1Change") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func Edit1Change() MsgBox(0, "", "Edit1") EndFunc Func Form1Close() Exit EndFunc Func Input1Change() MsgBox(0, "", "Input1") EndFunc Func Input2Change() MsgBox(0, "", "Input2") EndFunc Func Input3Change() MsgBox(0, "", "Input3") EndFunc Func Input4Change() MsgBox(0, "", "Input4") EndFunc Func Input5Change() MsgBox(0, "", "Input5") EndFunc Func captureEnter() $text = ControlGetFocus("Form1") MsgBox(0, "", $text) EndFunc
  8. I would like to manipulate the page layout in Internet explorer in a window opened with Dim $oIE = _IECreateEmbedded () When you right mouse click on the window you get 2 options print and print preview. Going to "print" is easy with _IEAction($oIE, "print") but you can't get to the Header and Footer and the Margins without going to print preview. I want to modify the margins to .17 each, set the Header and Footer to nothing and change the orientation to landscape. Is there an alternative method to arriving at the print menu? Any help is greatly appreciated
  9. I have been looking at your mysql udf and it looks great. Is there a way to read the results of the query into a 2d array? Is there a code snippet or link I could see?
  10. I seem to be having an error show up and the program stops even though it seems to be working properly. The error I get is: Line 848 (File "C:\Inetpub\wwwroot\IE.au3"): If IsObj($o_object.elements.item($s_name, $i_index)) Then If IsObj($o_object ^ ERROR Error: Variable must be of type "Object". IS this something I am doing? I get this error at the end of the script not at the beginning, but the message box I have programmed doesn't show up so the script stops dead.
  11. How does one lopp through a two dimension array if one doesn't know the length of the second array. Rows are easy but what about the columns. the columns can be any number from 1 to 10 Any Help is appreciated.
  12. Can you give me an example?
  13. I would like to use a mixture of perl and Autoit, is this possible? I noticed that the script editor scite has a open perl properties. What does this do? Can one include perl scripting within AutoIt?
×
×
  • Create New...