topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 4:18 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - stophereareyou [ switch to compact view ]

Pages: [1]
1
Developer's Corner / Save/Load list of hotstrings in ini autohotkey
« on: February 11, 2018, 07:51 AM »
I want to Save/Load list of hotstrings in ini.
I can save with iniwrite but how to load saved list so they work as hotstrings is my problem.
I have tried #include, list.ini
this works. Loads list and saved list can be loaded with script reload in .ahk file.
But when I compile to .exe, list.ini get compiled and embedded in same exe file, iniwrite writes new hotstring in local directory list.ini but only load hotstrings from embedded file.

2
Though the Keys enum has identical values for Enter and Return (it also has a number of other duplicates), ToString shows a different value.

If you run this linq expression in linqpad, you'll see what I mean.

Code: C# [Select]
  1. Enum.GetNames(typeof(System.Windows.Forms.Keys))
  2.     .GroupBy(k => Enum.Parse(typeof(System.Windows.Forms.Keys), k))
  3.     .Where(g => g.Count() > 1)
  4.     .Select(g => String.Join(", ", g.Select(k => k.ToString()).ToArray())).Dump();

Check for the tostring if you really need to know the difference.

Hello wraith808,
I did not understand all of it but,
Tried it in C# as follows

           
 foreach (var VARIABLE in Enum.GetNames(typeof (System.Windows.Forms.Keys))
                .GroupBy(k => Enum.Parse(typeof (System.Windows.Forms.Keys), k))
                .Where(g => g.Count() > 1)
                .Select(g => String.Join(", ", g.Select(k => k.ToString()).ToArray())))
            {
                richTextBox1.AppendText(VARIABLE+"\r\n");
            }

Got following...
Enter, Return
CapsLock, Capital
HangulMode, HanguelMode, KanaMode
KanjiMode, HanjaMode
IMEAccept, IMEAceept
Prior, PageUp
PageDown, Next
Snapshot, PrintScreen
OemSemicolon, Oem1
Oem2, OemQuestion
Oem3, Oemtilde
Oem4, OemOpenBrackets
OemPipe, Oem5
OemCloseBrackets, Oem6
OemQuotes, Oem7
Oem102, OemBackslash

that is Enter and Return does have same value,
Thanks for your time and code, I might have missed your point if you are telling something more than I've understood,

but is there any difference between Main Enter Key and Enter Key on Numpad!?

Firdaus Shaikh
('',)

3
Developer's Corner / Distinguish Enter and Numpad Enter Key c#.net
« on: March 16, 2013, 04:24 AM »
Hello Every one,

Is there any way to distinguish Numpad Enter key and Normal Enter Key,

in c#.net<code> KeyCode, KeyCode</code> and <code>KeyValue</code> for both keys are same,

is there any other way or some workaround for distinguishing Events raised by both keys?!


Firdaus Shaikh
('',)

4
Developer's Corner / Re: Titlebar Button
« on: January 14, 2013, 01:22 AM »
Well actually I tried in c#.net, there are no default options,
There is 'ActiveButtons' library that implemented it
information here
and Code and Sample here
but it only add button near minimize button and don't allow to add buttons at different location, with this:
> I can't add button near minimize button and near title icon...
> I can't add button any other location than near minimize button...

I have tried and googled for other possible sample or tutorial for same but there are none as clean as this...

there are many software those implement such thing eg IDM, 4t-min and other like those implement extra functions like minimise to tray, roll window in titlebar, locking window on top etc.
even I have seen in this forum or somewhere, a code to add time in title bar in ahk,

is there other way i can do, or in different language and use it's library to implement it's controls may be...


by the thanks for your reply Renegade,
Firdaus Shaikh.

5
Developer's Corner / Titlebar Button
« on: January 13, 2013, 04:27 AM »
is there a way to add custom buttons to show and keep on title bar, at given coordinates?

i.e. near minimize button and/or near icon or title...


Firdaus Shaikh.

6
Developer's Corner / Re: Autohotkey Suspend status
« on: January 01, 2013, 12:11 PM »
In an expression, don't use percentage symbols, e.g.:

Code: Autohotkey [Select]
  1. If ( A_IsSuspended = 1 )

Thank You skwire, you made my day...
Thanks alot...

Firdaus Shaikh

7
Developer's Corner / Autohotkey Suspend status
« on: January 01, 2013, 10:52 AM »
what I'm doing wrong

ScrollLock::
Suspend

if(%A_IsSuspended%==1)
{
 SetScrollLockState, off
}
else
{
 SetScrollLockState, on
}
return

what is wrong with if condition? I didn't get this

Firdaus Shaikh

8
Developer's Corner / Re: change page size for default printer
« on: September 26, 2012, 04:53 AM »
there, this works exactly as I wanted,

this is class I found somewhere while searching internet,
it adds/changes custom paper size for default printer,
Spoiler
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Security;
using System.ComponentModel;
using System.Drawing.Printing;

namespace MJMCustomPrintForm
{
/// <summary>
/// Summary description for MJMCustomPrintForm.
/// </summary>
public class MJMCustomPrintForm
{
// Make a static class
private MJMCustomPrintForm()
{
}

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
internal struct structPrinterDefaults
{
[MarshalAs(UnmanagedType.LPTStr)] public String pDatatype;
public IntPtr pDevMode;
[MarshalAs(UnmanagedType.I4)] public int DesiredAccess;
};

[DllImport("winspool.Drv", EntryPoint="OpenPrinter", SetLastError=true,
CharSet=CharSet.Unicode, ExactSpelling=false,CallingConvention=CallingConvention.StdCall),
SuppressUnmanagedCodeSecurityAttribute()]
internal static extern bool OpenPrinter([MarshalAs(UnmanagedType.LPTStr)]
string printerName,
out IntPtr phPrinter,
ref structPrinterDefaults pd);

[DllImport("winspool.Drv", EntryPoint="ClosePrinter", SetLastError=true,
CharSet=CharSet.Unicode, ExactSpelling=false,
CallingConvention=CallingConvention.StdCall),SuppressUnmanagedCodeSecurityAttribute()]
internal static extern bool ClosePrinter(IntPtr phPrinter);

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
internal struct structSize
{
public Int32 width;
public Int32 height;
}

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
internal struct structRect
{
public Int32 left;
public Int32 top;
public Int32 right;
public Int32 bottom;
}

[StructLayout(LayoutKind.Explicit, CharSet=CharSet.Unicode)]
internal struct FormInfo1
{
[FieldOffset(0), MarshalAs(UnmanagedType.I4)] public uint Flags;
[FieldOffset(4), MarshalAs(UnmanagedType.LPWStr)] public String pName;
[FieldOffset(8)] public structSize Size;
[FieldOffset(16)] public structRect ImageableArea;
};

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi/* changed from CharSet=CharSet.Auto */)]
internal struct structDevMode
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=32)] public String
dmDeviceName;
[MarshalAs(UnmanagedType.U2)] public short dmSpecVersion;
[MarshalAs(UnmanagedType.U2)] public short dmDriverVersion;
[MarshalAs(UnmanagedType.U2)] public short dmSize;
[MarshalAs(UnmanagedType.U2)] public short dmDriverExtra;
[MarshalAs(UnmanagedType.U4)] public int dmFields;
[MarshalAs(UnmanagedType.I2)] public short dmOrientation;
[MarshalAs(UnmanagedType.I2)] public short dmPaperSize;
[MarshalAs(UnmanagedType.I2)] public short dmPaperLength;
[MarshalAs(UnmanagedType.I2)] public short dmPaperWidth;
[MarshalAs(UnmanagedType.I2)] public short dmScale;
[MarshalAs(UnmanagedType.I2)] public short dmCopies;
[MarshalAs(UnmanagedType.I2)] public short dmDefaultSource;
[MarshalAs(UnmanagedType.I2)] public short dmPrintQuality;
[MarshalAs(UnmanagedType.I2)] public short dmColor;
[MarshalAs(UnmanagedType.I2)] public short dmDuplex;
[MarshalAs(UnmanagedType.I2)] public short dmYResolution;
[MarshalAs(UnmanagedType.I2)] public short dmTTOption;
[MarshalAs(UnmanagedType.I2)] public short dmCollate;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=32)] public String dmFormName;
[MarshalAs(UnmanagedType.U2)] public short dmLogPixels;
[MarshalAs(UnmanagedType.U4)] public int dmBitsPerPel;
[MarshalAs(UnmanagedType.U4)] public int dmPelsWidth;
[MarshalAs(UnmanagedType.U4)] public int dmPelsHeight;
[MarshalAs(UnmanagedType.U4)] public int dmNup;
[MarshalAs(UnmanagedType.U4)] public int dmDisplayFrequency;
[MarshalAs(UnmanagedType.U4)] public int dmICMMethod;
[MarshalAs(UnmanagedType.U4)] public int dmICMIntent;
[MarshalAs(UnmanagedType.U4)] public int dmMediaType;
[MarshalAs(UnmanagedType.U4)] public int dmDitherType;
[MarshalAs(UnmanagedType.U4)] public int dmReserved1;
[MarshalAs(UnmanagedType.U4)] public int dmReserved2;
}

      [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
         internal struct PRINTER_INFO_9
      {
         public IntPtr pDevMode;
      }

[DllImport("winspool.Drv", EntryPoint="AddFormW", SetLastError=true,
CharSet=CharSet.Unicode, ExactSpelling=true,
CallingConvention=CallingConvention.StdCall), SuppressUnmanagedCodeSecurityAttribute()]
internal static extern bool AddForm(
         IntPtr phPrinter,
[MarshalAs(UnmanagedType.I4)] int level,
         ref FormInfo1 form);

/*    This method is not used
[DllImport("winspool.Drv", EntryPoint="SetForm", SetLastError=true,
CharSet=CharSet.Unicode, ExactSpelling=false,
CallingConvention=CallingConvention.StdCall), SuppressUnmanagedCodeSecurityAttribute()]
internal static extern bool SetForm(IntPtr phPrinter, string paperName,
[MarshalAs(UnmanagedType.I4)] int level, ref FormInfo1 form);
*/
[DllImport("winspool.Drv", EntryPoint="DeleteForm", SetLastError=true,
CharSet=CharSet.Unicode, ExactSpelling=false,CallingConvention=CallingConvention.StdCall),
SuppressUnmanagedCodeSecurityAttribute()]
internal static extern bool DeleteForm(
         IntPtr phPrinter,
[MarshalAs(UnmanagedType.LPTStr)] string pName);

[DllImport("kernel32.dll", EntryPoint="GetLastError", SetLastError=false,
ExactSpelling=true, CallingConvention=CallingConvention.StdCall),
SuppressUnmanagedCodeSecurityAttribute()]
internal static extern Int32 GetLastError();

[DllImport("GDI32.dll", EntryPoint="CreateDC", SetLastError=true,
CharSet=CharSet.Unicode, ExactSpelling=false,
CallingConvention=CallingConvention.StdCall),
SuppressUnmanagedCodeSecurityAttribute()]
internal static extern IntPtr CreateDC([MarshalAs(UnmanagedType.LPTStr)]
string pDrive,
[MarshalAs(UnmanagedType.LPTStr)] string pName,
[MarshalAs(UnmanagedType.LPTStr)] string pOutput,
ref structDevMode pDevMode);

[DllImport("GDI32.dll", EntryPoint="ResetDC", SetLastError=true,
CharSet=CharSet.Unicode, ExactSpelling=false,
CallingConvention=CallingConvention.StdCall),
SuppressUnmanagedCodeSecurityAttribute()]
internal static extern IntPtr ResetDC(
         IntPtr hDC,
         ref structDevMode
pDevMode);

[DllImport("GDI32.dll", EntryPoint="DeleteDC", SetLastError=true,
CharSet=CharSet.Unicode, ExactSpelling=false,
CallingConvention=CallingConvention.StdCall),
SuppressUnmanagedCodeSecurityAttribute()]
internal static extern bool DeleteDC(IntPtr hDC);

      [DllImport("winspool.Drv", EntryPoint="SetPrinterA", SetLastError=true,
          CharSet=CharSet.Auto, ExactSpelling=true,
          CallingConvention=CallingConvention.StdCall), SuppressUnmanagedCodeSecurityAttribute()]
      internal static extern bool SetPrinter(
         IntPtr hPrinter,
         [MarshalAs(UnmanagedType.I4)] int level,
         IntPtr pPrinter,
         [MarshalAs(UnmanagedType.I4)] int command);

      /*
       LONG DocumentProperties(
         HWND hWnd,               // handle to parent window
         HANDLE hPrinter,         // handle to printer object
         LPTSTR pDeviceName,      // device name
         PDEVMODE pDevModeOutput, // modified device mode
         PDEVMODE pDevModeInput,  // original device mode
         DWORD fMode              // mode options
         );
       */
      [DllImport("winspool.Drv", EntryPoint="DocumentPropertiesA", SetLastError=true,
      ExactSpelling=true, CallingConvention=CallingConvention.StdCall)]
      public static extern int DocumentProperties(
         IntPtr hwnd,
         IntPtr hPrinter,
         [MarshalAs(UnmanagedType.LPStr)] string pDeviceName /* changed from String to string */,
         IntPtr pDevModeOutput,
         IntPtr pDevModeInput,
         int fMode
         );

      [DllImport("winspool.Drv", EntryPoint="GetPrinterA", SetLastError=true,
      ExactSpelling=true, CallingConvention=CallingConvention.StdCall)]
      public static extern bool GetPrinter(
         IntPtr hPrinter,
         int dwLevel /* changed type from Int32 */,
         IntPtr pPrinter,
         int dwBuf /* chagned from Int32*/,
         out int dwNeeded /* changed from Int32*/
         );

      // SendMessageTimeout tools
      [Flags] public enum SendMessageTimeoutFlags : uint
      {
         SMTO_NORMAL         = 0x0000,
         SMTO_BLOCK          = 0x0001,
         SMTO_ABORTIFHUNG    = 0x0002,
         SMTO_NOTIMEOUTIFNOTHUNG = 0x0008
      }
      const int WM_SETTINGCHANGE = 0x001A;
      const int HWND_BROADCAST = 0xffff;

      [DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)]
      public static extern IntPtr SendMessageTimeout(
         IntPtr windowHandle,
         uint Msg,
         IntPtr wParam,
         IntPtr lParam,
         SendMessageTimeoutFlags flags,
         uint timeout,
         out IntPtr result
         );
     
      public static void AddMjm80MmPaperSizeToDefaultPrinter()
      {
         AddCustomPaperSizeToDefaultPrinter("MJM 80mm * Receipt Length", 80.1f, 4003.9f);
      }

      public static void AddMjm104MmPaperSizeToDefaultPrinter()
      {
         AddCustomPaperSizeToDefaultPrinter("MJM 104mm * Receipt Length", 104.1f, 4003.9f);
      }

      /// <summary>
      /// Adds the printer form to the default printer
      /// </summary>
      /// <param name="paperName">Name of the printer form</param>
      /// <param name="widthMm">Width given in millimeters</param>
      /// <param name="heightMm">Height given in millimeters</param>
      public static void AddCustomPaperSizeToDefaultPrinter(string paperName, float widthMm, float heightMm)
      {
         PrintDocument pd = new PrintDocument();
         string sPrinterName = pd.PrinterSettings.PrinterName;
         AddCustomPaperSize(sPrinterName, paperName, widthMm, heightMm);
      }

      /// <summary>
      /// Add the printer form to a printer
      /// </summary>
      /// <param name="printerName">The printer name</param>
      /// <param name="paperName">Name of the printer form</param>
      /// <param name="widthMm">Width given in millimeters</param>
      /// <param name="heightMm">Height given in millimeters</param>
public static void AddCustomPaperSize(string printerName, string paperName, float
widthMm, float heightMm)
{
if (PlatformID.Win32NT == Environment.OSVersion.Platform)
{
// The code to add a custom paper size is different for Windows NT then it is
// for previous versions of windows

const int PRINTER_ACCESS_USE = 0x00000008;
const int PRINTER_ACCESS_ADMINISTER = 0x00000004;
const int FORM_PRINTER =   0x00000002;

structPrinterDefaults defaults = new structPrinterDefaults();
defaults.pDatatype = null;
defaults.pDevMode = IntPtr.Zero;
defaults.DesiredAccess = PRINTER_ACCESS_ADMINISTER | PRINTER_ACCESS_USE;

IntPtr hPrinter = IntPtr.Zero;

// Open the printer.
if (OpenPrinter(printerName, out hPrinter, ref defaults))
{
try
{
                  // delete the form incase it already exists
DeleteForm(hPrinter, paperName);
                  // create and initialize the FORM_INFO_1 structure
FormInfo1 formInfo = new FormInfo1();
formInfo.Flags = 0;
formInfo.pName = paperName;
                  // all sizes in 1000ths of millimeters
formInfo.Size.width = (int)(widthMm * 1000.0);
formInfo.Size.height = (int)(heightMm * 1000.0);
formInfo.ImageableArea.left = 0;
formInfo.ImageableArea.right = formInfo.Size.width;
formInfo.ImageableArea.top = 0;
formInfo.ImageableArea.bottom = formInfo.Size.height;
if (!AddForm(hPrinter, 1, ref formInfo))
{
StringBuilder strBuilder = new StringBuilder();
strBuilder.AppendFormat("Failed to add the custom paper size {0} to the printer {1}, System error number: {2}",
paperName, printerName, GetLastError());
throw new ApplicationException(strBuilder.ToString());
}

                  // INIT
                  const int DM_OUT_BUFFER = 2;
                  const int DM_IN_BUFFER = 8;
                  structDevMode devMode = new structDevMode();
                  IntPtr hPrinterInfo, hDummy;
                  PRINTER_INFO_9 printerInfo;
                  printerInfo.pDevMode = IntPtr.Zero;
                  int iPrinterInfoSize, iDummyInt;


                  // GET THE SIZE OF THE DEV_MODE BUFFER
                  int iDevModeSize = DocumentProperties(IntPtr.Zero, hPrinter, printerName, IntPtr.Zero, IntPtr.Zero, 0);

                  if(iDevModeSize < 0)
                     throw new ApplicationException("Cannot get the size of the DEVMODE structure.");

                  // ALLOCATE THE BUFFER
                  IntPtr hDevMode = Marshal.AllocCoTaskMem(iDevModeSize + 100);

                  // GET A POINTER TO THE DEV_MODE BUFFER
                  int iRet = DocumentProperties(IntPtr.Zero, hPrinter, printerName, hDevMode, IntPtr.Zero, DM_OUT_BUFFER);

                  if(iRet < 0)
                     throw new ApplicationException("Cannot get the DEVMODE structure.");

                  // FILL THE DEV_MODE STRUCTURE
                  devMode = (structDevMode)Marshal.PtrToStructure(hDevMode, devMode.GetType());

                  // SET THE FORM NAME FIELDS TO INDICATE THAT THIS FIELD WILL BE MODIFIED
                  devMode.dmFields = 0x10000; // DM_FORMNAME
                  // SET THE FORM NAME
                  devMode.dmFormName = paperName;

                  // PUT THE DEV_MODE STRUCTURE BACK INTO THE POINTER
                  Marshal.StructureToPtr(devMode, hDevMode, true);

                  // MERGE THE NEW CHAGES WITH THE OLD
                  iRet = DocumentProperties(IntPtr.Zero, hPrinter, printerName,
                           printerInfo.pDevMode, printerInfo.pDevMode, DM_IN_BUFFER | DM_OUT_BUFFER);

                  if(iRet < 0)
                     throw new ApplicationException("Unable to set the orientation setting for this printer.");

                  // GET THE PRINTER INFO SIZE
                  GetPrinter(hPrinter, 9, IntPtr.Zero, 0, out iPrinterInfoSize);
                  if(iPrinterInfoSize == 0)
                     throw new ApplicationException("GetPrinter failed. Couldn't get the # bytes needed for shared PRINTER_INFO_9 structure");

                  // ALLOCATE THE BUFFER
                  hPrinterInfo = Marshal.AllocCoTaskMem(iPrinterInfoSize + 100);

                  // GET A POINTER TO THE PRINTER INFO BUFFER
                  bool bSuccess = GetPrinter(hPrinter, 9, hPrinterInfo, iPrinterInfoSize, out iDummyInt);

                  if(!bSuccess)
                     throw new ApplicationException("GetPrinter failed. Couldn't get the shared PRINTER_INFO_9 structure");

                  // FILL THE PRINTER INFO STRUCTURE
                  printerInfo = (PRINTER_INFO_9)Marshal.PtrToStructure(hPrinterInfo, printerInfo.GetType());
                  printerInfo.pDevMode = hDevMode;

                  // GET A POINTER TO THE PRINTER INFO STRUCTURE
                  Marshal.StructureToPtr(printerInfo, hPrinterInfo, true);

                  // SET THE PRINTER SETTINGS
                  bSuccess = SetPrinter(hPrinter, 9, hPrinterInfo, 0);

                  if(!bSuccess)
                     throw new Win32Exception(Marshal.GetLastWin32Error(), "SetPrinter() failed.  Couldn't set the printer settings");

                  // Tell all open programs that this change occurred.
                  SendMessageTimeout(
                     new IntPtr(HWND_BROADCAST),
                     WM_SETTINGCHANGE,
                     IntPtr.Zero,
                     IntPtr.Zero,
                     MJMCustomPrintForm.SendMessageTimeoutFlags.SMTO_NORMAL,
                     1000,
                     out hDummy);
}
finally
{
ClosePrinter(hPrinter);
}
}
else
{
StringBuilder strBuilder = new StringBuilder();
strBuilder.AppendFormat("Failed to open the {0} printer, System error number: {1}",
printerName, GetLastError());
throw new ApplicationException(strBuilder.ToString());
}
}
else
{
structDevMode pDevMode = new structDevMode();
IntPtr hDC = CreateDC(null, printerName, null, ref pDevMode);
if (hDC != IntPtr.Zero)
{
const long DM_PAPERSIZE = 0x00000002L;
const long DM_PAPERLENGTH = 0x00000004L;
const long DM_PAPERWIDTH = 0x00000008L;
pDevMode.dmFields = (int)(DM_PAPERSIZE | DM_PAPERWIDTH | DM_PAPERLENGTH);
pDevMode.dmPaperSize = 256;
pDevMode.dmPaperWidth = (short)(widthMm * 1000.0);
pDevMode.dmPaperLength = (short)(heightMm * 1000.0);
ResetDC(hDC, ref pDevMode);
DeleteDC(hDC);
}
}
}
}
}

I'm adding this to know everyone that I have found the solution, and may be as information...
I don't understand all the code but calling function with paper name and height, width works as I wanted
through this method
public static void AddCustomPaperSize(string printerName, string paperName, float widthMm, float heightMm)
rough example:
printerName = getPrinterName()// code to get Default Printer Name;
float width = 12.0F; //fixed in my case
float height = 4.5; //size of report without item rows

height += getNumberOfRows() //get here Number of Rows of Content and add it to height
AddCustomPaperSize(printerName, "customPaper", width, height); //call function

//code for print may be here
,


thanks for help everyone,
really getting replies/answers for question makes feel that someone is helping me along side me on this project...

9
Developer's Corner / Re: change page size for default printer
« on: September 22, 2012, 11:36 AM »
It sounds to me like it is just streaming to report to the printer as one big report sized page. Instead of breaking the output down into (paginated) page sized blocks that would then "fit" into the tear off points.

actually I don't want to paginate, the page used for printing is Roll Paper, it is continuous paper without perforation for cutting page, I haven't kept top and bottom margin for the report setting and because I have to set some page size I have set it 12cm x 6 cm that is my content of report without any rows of item content,
what I want is working that report is printing on paper continuously on paper as there is no top or bottom margin but at the end of report printer feed remaining size paper out
i.e.

|  content   |
|  content   |
|  content   |
 -- -- - -- -- 6 cm height
|  content   |
|  content   |
|  content   |
 -- -- - -- -- 6 cm height
|  content   |
|               |--I want to stop tear off at this
|               |
 -- -- - -- -- 6 cm height

I can calculate total page size required according to rows in report, in above report I require page height 14 cm, paper size will change as per rows each time...
If I be able to change custom sized paper size dynamically through script...

Just to be clear, what is actually sending the print job/report to the print driver, your code, or the Crystal/MS reporting software.

If it is your code that is sending the print job to the driver, then you should be able to paginate it to any paper size you like.

reporting software is sending print and I can't modify reports page size as it only accept page size from its default enumerated list... so can't assign custom size but can be printed on default page for printer,
If I can change default page size according to content of report, that would solve my all problem...

Thanks SJ and Renegade for your replies

10
Developer's Corner / Re: change page size for default printer
« on: September 21, 2012, 10:44 AM »
Thanks Renegade,
I tried it,
for reporting I'm use either Crystal Report or MS Report and they don't support/have functionality for directly or through code changing page size

I can only able to select the page sizes defined in printer settings of printer for them,
I have created custom (and can change)page size in printer settings manually but I want to change that page size dynamically or through code or some script...

can't we automate or code this...

11
Developer's Corner / Re: change page size for default printer
« on: September 21, 2012, 09:48 AM »
Detail given are insufficient...is this for a program you are writing, using, or trying to configure?

well actually I've written a program in c#.net, and the report shows records of purchased or sold items, printing on paper roll but  there is no option (default or whatsoever) to set no height for paper so it will automatically print only records and set paper position to tear off position (epson lx 300+ II),

what happens is records print on page of given height if a single record printed on second page (as per set paper height) the printer feed the paper out till that paper height + tear off settings height...
and it has to manually reversed in printer...

tried many things but there is no default solution or work around,

well I think if we can manually set the page/paper size (for custom page) through 'Server Properties' in 'Printers and Faxes' then there could be macro or program that will set it directly for the page height send through my program,

may be this will be dirty work around but I think or get any other solution sadly...

well if we can create a custom form of certain or change its page size manually there may be possibility it can be done through program, that's just idea I came with, but doesn't know how...

12
Developer's Corner / change page size for default printer
« on: September 20, 2012, 08:13 AM »
Is there any way to change the page/paper size of custom paper (set as default for printer), or add new custom sized paper in printer settings

13
General Software Discussion / Re: Overlap Wallpaper
« on: September 20, 2012, 08:10 AM »
Updated to version 2.0.1, long over due, nearly a year.

- New setting, reload photo after every given seconds.

@stophereareyou, I have added the 'interval' option as 'reload'.

Tried the latest version,
Few things I observed...
Spoiler
http://imageshack.us/a/img844/9898/screenshotjnp.png


overlapped wallpaper (lets call it 'frame' for convenience) can not be set for custom size, it retains proportions (see the image, I kept height 100 and width 200)

Again, about Reload, you may have misunderstood my previous reply,
I have folder containing 2-4 images and want to show them as 'frame', after certain interval...
And adding a bottom shadow will make 'frame' stand out on the main wallpaper,

I liked the Idea and want to use it, Please do these three changes...


14
General Software Discussion / Re: Overlap Wallpaper
« on: September 17, 2011, 03:27 PM »
Hello Anand,
I tried Overlap Wallpaper (version 1.5.0), well that is "nice to have" app  :Thmbsup:,
I'm not sure it is right way (right thread) to ask,
but as background image and overlayed may have different (combinations of) color / contrasts
the overlayed image may not look stand out(may not be correct words)

>adding facility to add frame to overlayed image and / or
simply a shadow at "right and bottom"/left and bottom" or as per location and users choice would separate the overlayed image from desktop wallpaper
>secondly not a must feature but a kind of slide show would be good for user set interval...

this is for information only...
Well, I have rainmeter installed, you can see frame over wallpaper,
Spoiler
http://img809.imageshack.us/img809/2857/mydesktopct.jpg


My friend liked it and wanted same on his pc but he don't know coding or tinkering(!) code for users with little or no knowledge of coding your app is great (don't take it as you know a wrong statement I'm just making my point clear...

Really liked the app and ease of doing what you said

Pages: [1]